I wrote a code that would create a user-defined structure named Flight with flightNumber and flightMiles members
Will someone please correct me if I am wrongCode:struct Flight { int flightNumber; int flightMiles; };
Thanks
Jamina
I wrote a code that would create a user-defined structure named Flight with flightNumber and flightMiles members
Will someone please correct me if I am wrongCode:struct Flight { int flightNumber; int flightMiles; };
Thanks
Jamina
The code looks right. But, do you have a problem with it? Otherwise the best way to test it is making your own program that uses it.
SoKrA-BTS "Judge not the program I made, but the one I've yet to code"
I say what I say, I mean what I mean.
IDE: emacs + make + gcc and proud of it.
Yes, the code you posted defines (not creates) a struct named Flight with those members. Do note that this does NOT create any of these structures, it only tells the compiler how that structure is made. Until you create an instance of the structure, you can't do anything useful.
Yeah, remember to create an instance of the struct by doing:
but of course use a better name for yoursCode:Flight instance_of_flight; instance_of_flight.flightNumber=635; instance_of_flight.flightMiles=22;