Ok, i messed up in my actual code i wasn't initializing the counter variable so it was garbage and wouldn't work. Thank you soooo much for all of your input you have solved my problem!
THANK YOU!
ok, it is now making it to the following function:
int ex_class::add(const ex_struct &my_ex_struct)
{
...
}
but how would i add something to the array something like this:
// This would be inside of the add member function
strcpy(my_fav[keep_count].name,my_ex_struct.name)...
I need help on how to have access to my variables when inside of the ex_class.add() function.
struct ex_struct
{
char name[21];
int num;
....
};
class ex_class
{
public:
ex_class();
int display_all();
int add(const ex_struct &);
private:
ex_struct new_struct[101]...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.