Hi there, new to the community and first of all just wanted to say its great to be here. I'm rather new to C++ and i was having an issue perhaps someone could clear up for me.

Alright, our instructor for a class im taking would give us simple programs that we needed to make little additions/manipulations to. "end1" would coincide with text that was in quotations. From what i understand the use of "end1" is to help ensure text in quotations compile and execute more accurately? Here is an example just to illustrate my point.

#include<iostream>

using namespace std ;

int main() ;
{
  cout << end1 ;
  cout << "Hello world." << end1 ;

  return (0) ;
}

For some reason whenever i try to compile my own code while including "end1", I get errors stating that "end1 is an unknown identifier". I apologize for not having the exact code and errors to copy and paste here but im at work at the moment. Just looking for any direction here as to why it might be giving me this error. Appreciate your time guys and have a great day

-alias

Recommended Answers

All 6 Replies

it isn't "end1" but "endl" (with an "el" not a "one") :)
The endl is short for "endline" and makes the console jump to a new line. cout << "Hello world.\n"; would have the same effect.

For future posts: if you post code here please use code-tags

oh wow, i feel dumb. Well that makes a lot of sense, i appreciate the response. Ill be sure to use the code-tags.

Yea you do not have to use the parentheses around the 0 either after return.

You can just do return 0;

Alright sounds good, i didnt know whether that was required or not i was just going off the format provided by our instructor. My only programming experience pre-C++ was python, and even that was fairly limited so im very open to any critiques/advice you all have. Been wanting to learn programming for awhile now.

I do apologize for the lack of code-tags btw, should have read the forum rules more closely. Just found you guys while im at work so bouncing around a lot between here and my work.

I made a few changes for you. Good luck with the C++. This website is very helpful.

#include <iostream>
 
using namespace std ;
 
int main()
{
cout << "Hello world." << endl;
 
return 0;
}
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.