Nothing is Showing

So, I'm just learning how to do C++. I'm required to change the Hello World code to show my name. I changed it but for some reason when I run the code nothing shows.
I get no errors but no output either.

1
2
3
4
5
6
7
#include <iostream>
using namespace std;

int main() {
	cout << "Name" << endl; // prints name
	return 0;
}


If the code is correct, what could be the problem?
Last edited on
Hi, Brianna. Why you put your rl name in here is beyond me.

http://www.cplusplus.com/forum/beginner/1988/#msg7262

If my first instinct is correct, this is your problem.
I'm confused. I went to that message but I'm not getting what is going on.
I'm getting errors in the code I copied from the first reply.
Okay, the errors went away. However, the console is still being cleared immediately. Here is the code I have, maybe you'll see something I missed.

1
2
3
4
5
6
7
8
9
10
11
#include <iostream>
#include <limits>
using namespace std;

int main() {

	std::cout << "Press ENTER to continue...";
	std::cin.ignore( std::numeric_limits<std::streamsize>::max(), '\n' );
	//cout << "Name" << endl; // prints name
	return 0;
lol...you just copied the code. You should go back and read it for its intended purpose, which is to help you figure out what's wrong with that code. What you copied in there is way too advanced for you to have done, and your instructor will see that instantly and fail you. I didn't point you over there so you could jack someone's code, I pointed you over there so that you could read the topic and get something out of it.

Believe me, if I wanted to just give you the answer, I could just do it. Your first program was written just fine, it's about how you're running the program.
That was kind of stupid of me to copy it.
Okay, I'll take the long way around and look into how I'm running it. What's irritating me is my TA is telling me to do stuff and I'm like "I did that already."
If you want to know a secret...TA's are just students who got a good grade in the class. That doesn't mean they know anything.
http://www.cplusplus.com/articles/iw6AC542/
tl; dr: execute your program from a console
Topic archived. No new replies allowed.