I have a question. The instructions given from the professor states to do the following:
Declare an array of five elements of type FLIGHT. Write a function that initializes the array(using structures).
My original Structure:
struct FLIGHT
{
long flightnum;
long Date;
char departcode
ete......
};
Declare an array of five elemens of type FLIGHT:
I did this in main,
FLIGHT numof[5];
getnum(numof[5]);//calling funtion
Write a function that initializes the array.
assuming I have written the funtion prototype and I have called the function in main, I wrote the following funtion per these intructions:
int getnum(int flightinfo)
{
FLIGHT numof[5]={1111}{1112}{1113}{1114}
Am I doing this correctly? Wouldn't the initialization only need the first element of the structure?



LinkBack URL
About LinkBacks



