Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create a function call it sampleINFO that generates sets of random data for the struct below. Note: the struct INFO is handed the address of

  1. Create a function call it sampleINFO that generates sets of random data for the struct below. Note: the struct INFO is handed the address of a block of memory (use pointer). The memory is then filled with the new data (strcpy)
  2. Create a function call it DisplayINFO that uses fprintf to display the struct to FILE *outFile. Pass the structure to your function as an argument either by address or by value.

struct INFO

{ char firstName[10];

char lastName[10];

char sex;

int age;

char position[25];

int recordNo;

} ;

char names[][10]={ "George","Ann","Renata","Betty","Sam","Vince", "Stephane",

"Ringo", "Helen","Elmer","Steve", "Aaron", "Kim", "George",

"Paul","John","Jean Luc","Colm" };

char lastNames[][10]= {"Smith","Kline","Chin","Arnold","Saxby","Jones", "Stivic",

"Michaud","Crompton","Ogilvy","Singh", "Picard", "Ngo"};

char role[][25]={"Captain","Ensign","Red Shirt","Red Shirt","Red Shirt", "Crew",

"Medical Officer","Science Officer","Crew","Crew","TransporterChief",

"Morale Officer","Crew", "Crew", "Navigator","Engineer"};

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Relational Database Design With Microcomputer Applications

Authors: Glenn A. Jackson

1st Edition

0137718411, 978-0137718412

More Books

Students also viewed these Databases questions

Question

LO2 Compare three types of individual incentives.

Answered: 1 week ago