Got one of my functions to work (just need to beautify the output...)
Code
void firstDec(string initial, int pos)
{
string string1, string2, stem;
int len, len1;
len = int(initial.length());
string1 = initial.substr(0,pos);
string2 = initial.substr(pos+1,len-pos);
len1 = int(string2.length());
stem = string2.substr(0,len1-2);
cout << "Nom " << string1 << string2 << endl;
cout << "Gen " << stem+"ae" << stem+"arum" << endl;
cout << "Dat " << stem+"ae" << stem+"is" << endl;
cout << "Acc " << stem+"am" << stem+"as" << endl;
cout << "Abl " << stem+"a" << stem+"is" << endl;
}
Now I am still tackling a new problem:
Now that I have a giant string of words, is there a way for me to like:
(1) Read a line of the string up until a RETURN charcter
(2) Create a sub string of that line
(3) Delete that line from the initial string
(4) Pass the substring to some function which checks to see which declination its in
(5) From there have that function pass the string to the proper declination function and print out the results
(6) repeat the process again until there is no longer any lines to read in the initial string
??
Code
string inputHandler(string initial)
{
string passedstring;
int pos, strlen;
strlen = int(initial.length());
pos = int(initial.find('\n'));
passedstring = initial.substr(0,pos);
initial.erase(0,pos+1);
return passedstring;
}
this seems to work, but now I need a way for it to loop. Everytime I add a loop, the program doesn't do any of the operations.
IE, if I had a while statement before the line with (pos = int blah blah)
I would run the program, enter in my array, pass it to that function, and it wouldn't do anything.
This post was edited by Eep on Sep 13 2012 03:01pm