J
jordanp
Hello,
I'm having a little trouble here and I'm hoping that somebody might be
able to help me out (win32 console program). First off, I know that I
can use class function inside of my struct as a struct object...but my
issue that I'm having is that my class function is set up so that it
sets 3 variables...
Example of my class object (has the getter(), and setter() functions
below this, but I won't display that here):
classExample(int record, string word = "", string def = "")
{
strWord = word;
strDef = def;
recordNum = record;
}
The way that I originally had it working was that I could just
implement it in my main source file like:
classExample wordOne(1, "Word", "Definition");
and then print it off by using my print function that is in my class by
doing this:
wordOne.printWordDef();
The trouble I'm having now is that I want to be able to use a struct to
contain classExamaple wordOne(); and allow the user to input his own
word and definition and have it automatically assign it a record
number, so they can add their own words and definitions to the program.
I'm not sure how I could go about doing this because every way that
I've tried doesn't seem to be working correctly. Any help would be
appreciated. Thanks in advance!
I'm having a little trouble here and I'm hoping that somebody might be
able to help me out (win32 console program). First off, I know that I
can use class function inside of my struct as a struct object...but my
issue that I'm having is that my class function is set up so that it
sets 3 variables...
Example of my class object (has the getter(), and setter() functions
below this, but I won't display that here):
classExample(int record, string word = "", string def = "")
{
strWord = word;
strDef = def;
recordNum = record;
}
The way that I originally had it working was that I could just
implement it in my main source file like:
classExample wordOne(1, "Word", "Definition");
and then print it off by using my print function that is in my class by
doing this:
wordOne.printWordDef();
The trouble I'm having now is that I want to be able to use a struct to
contain classExamaple wordOne(); and allow the user to input his own
word and definition and have it automatically assign it a record
number, so they can add their own words and definitions to the program.
I'm not sure how I could go about doing this because every way that
I've tried doesn't seem to be working correctly. Any help would be
appreciated. Thanks in advance!