to maddog: it WORKED - thanks so much
to TheIdeasMan: I can see why in terms of knowing nothing about c++ why you would not want to call main() into anything, but I want to know why not? not to be rude, im just not sure why there would be a problem with that and I want to learn why. Also I declared main to see if it would solve anything (it didnt) and forgot to take it out, thanks for pointing that out!
as to my final problem, I have those case statements in there to determine things for example:
in the file we are given the story which has words in it, but when there are words that we need to replace it looks like this
<{> <adjective> <}>
so I have the logic to remove the first set of <{> and replace it with a " and a space
and the last set with a space and "
so it looks like this:
" <adjective> "
then the logic goes through and says remove the < and > and bring the " in closer and capitalize the first letter and add a tab so it looks like this:
Adjective:
then the enter what they want in there, for this example the enter "happy"
so my program changes Adjective: to "happy" and displays that like the example below however it messes with some other things
> My pet cat is very "happy" .\n
Exp: My pet cat is very "happy".\n
> So is my dog.
> \n
Exp: \n
|
there are space before those new lines and there should not be.
I thought it was this section of the program:
1 2 3
|
case '}':
cout << '"';
cout << ' ';
|
but that just messes up another part of the program as well
so I thought about adding in something that will determine if it is the end of line or file because that's when it happens, but i cant quite get the logic right, here is what i am trying:
if "end of line"
cin.ignore();
im not sure if that would work or not but that is what I am trying to do... any thoughts?