THanks, I was able to solve that issue. FINALLY. I really appreciate the help from everyone here.
However, I now have another dilemma. I know we covered this in my class, but I forgot the proper way to structure the following situation:
I need to implement this function:
int CmdExec(string cmdstring, char& plotChar, int& mode, int& badPos)
This function parses the command string, ...The current position starts at (1, 1), the current character starts off as plotChar, and the current mode starts as mode. If the command string is syntactically valid, and all plotting commands execute successfully, this function returns 0 when the plotting actions are completed and does not modify the badPos parameter; plotchar will be the (possibly changed) current character and mode will be the (possibly changed) current mode. //
so basically the user is prompted to enter a series of characters to determine how a line will be drawn on a graph, 20x30.
if the user enters acceptable characters(ill post them below), the graph should work. if not, cout some cheeky **** to tell them to try again. or if their entry is outside of the acceptable length, end program. I have just about everything else but cant make this thing work right without errors
these are the series of possible commands that should be allowed
1 2 3 4 5 6 7 8
|
Horiz [Hh][-][0-9][0-9]
Verti: [Vv}[0-9][0-9]
Fg [Ff]' ' -> isprint {this shouldn't be able to work if blank}
Bg: [Bb]' ' -> same as fg
Clear: Cc
H-20 for char c:s
a*=10; a +=c-0
|
a string input from the user should include only the letters, H(#),V(#), FG || BG, C or c, and any numbers from 1-99 immediately after a letter, as well as the (-)negative symbol. I had the format written in my notes, but I guess I wasn't descriptive enough because whatever I try brings out an error.
again, thanx for the help