How would I go about looping this?
I know about the for loop, about the while loop etc. But my interest is in doing a loop with a variable. Like, you enter 5 for NumPrompts and it makes 5 prompts. Or you enter 10 and it makes 10, etc. Before you redirect me to MSDN, or elsewhere: Please know I already looked. I would greatly appreciate any help.Code:cout << "Please enter the number of prompts you desire: "; getline (cin, NumPrompts); "\n"; std::string command("C:\\windows\\system32\\ping.exe "); command.append(" ").append(Address); command.append(" ").append(Parameter); command.append(" ").append(Bytes); system(command.c_str());
Edit: Oh yeah, whenever I try to use for or while, my compiler (dev c++) gives me an error that command is undeclared, but it runs fine without the loop.