Im not making my self clear enough, apoligies.
I hope this code will help explain myself.
Code:
#include <iostream>
int main()
{
// Let's replace your while() loop with a for() loop so it's more intuitive to read.
// In a for() loop, you can declare a variable that will only be in that loop's scope.
// This is a GoodThing(tm). It helps your program not use as much memory.
for (int x = 0; x < 10000; x++)
{
std::cout << x << std::endl;
}
// std::cout is overloaded. You can string together multiple <<'s, and it helps readability most of the time.
std::cout << "\nTotal files placed in your computer = " << "9999\n";
std::cout << "Happy holidays!\n\n";
std::cout << "Do you think I'm telling the truth?\n\n";
std::cout << "1 = yes\n";
std::cout << "2 = no\n\n";
std::cout << ">> "; // good idea to let the user know you expect input.
int answer; // good idea to declare variables near the point of first use.
std::cin >> answer;
if (answer != 1)
{
std::cout << "\nWell if you're not going to believe me. . .\n";
std::cout << ". . .maybe I should add some more. Would you like that?\n";
}
std::cin.ignore(80, '\n'); // This will flush the newline from stdin (the input buffer).
std::cout << "\n\n1 = yes\n";
std::cout << "2 = no\n\n";
std::cout << ">> ";
//this is half completed, i was going to cacth variable, and act upon it later.
else if (answer == 1)
// this else if, is still acting upon the first variable , x,.
//the first stated code to be completed if ,x, was not 1.
// now i am stating code which should be completed, if ,x, does = 1
{
for (int y = 0; y < 100000; y++)
{
std::cout << y << std::endl;
}
std::cout << "\nGood....Thats very good. For i have now removed them all!\n";
std::cout << "Press enter to quit\n";
std::cin.get();
}
std::cout << "\n\nAnd again please....\n\n"
std::cin.get();
return(0); // ALWAYS RETURN A VALUE FROM MAIN().