[code]I'm trying to pass my structure to a function using switch method, so that It will ask for user's name and age then then from the switch method it will call a print function, but my coding is not working. could anyone enlighten me?
@MikeyBoy 2: what do you mean can you show an example of how it would be?
My switch function work and all but its just that my print function does not print out the value from the structure that i previously entered by addRecord function.
its just that i've been stuck with this problem for a few days now. and don't know why. sorry if this irritates you. and yes it print out a bunch of garbage :|
Asking the question doesn't irritate people. Withholding information about the problem you're trying to solve irritates people. Why on earth would you withhold information that would help people solve your problem for you?
In printAllRecords(), you create a new, uninitialised FootballClub object, and immediately print out the contents. It's not surprising you're getting garbage, because you haven't set those values to anything.
Presumably, what you really intended that function for is to print out the contents of an object that gets passed in as a function parameter?
I'm 99.9999% certain that your book will tell you how to pass parameters into functions. It's one of the most basic and fundamental elements of C and C++ programming, so if it doesn't show you how to do that, then throw it away and find a decent book instead.
You've deleted your code from your OP, so I can't advise you on where to make your function calls from.