what does endl mean? i've seen it like this:
cout<<"hello"<<endl; i'm guessing i means end line.. but i'm not sure
i would right the above code like this:
cout<<"hello";
is the endl more proper?
thanks a bunch
-jumbo-shrimp
what does endl mean? i've seen it like this:
cout<<"hello"<<endl; i'm guessing i means end line.. but i'm not sure
i would right the above code like this:
cout<<"hello";
is the endl more proper?
thanks a bunch
-jumbo-shrimp
endl prints a newline character and flushes the stream.
My best code is written with the delete key.
You could write the code like that, but then any subsequent output would be on the same line. If instead you want output to continue on a newline, you need to do write an additional instruction for that.i would right the above code like this:
cout<<"hello";
is the endl more proper?
It's more efficient to use '\n' like this:
cout<<hello'\n';
but at this point in your C++ learning, don't wouldn't worry about it: use endl or '\n' if you want output to continue on a newline.
not to be a butt, but i believe it would be
notCode:cout << "hello\n";
because your code could be used for a string, if its predefined, but then you would have to add it after the string before output im not sure you can do it that way exactly.Code:cout << hello'\n';