Hey all, a little help needed

Please support our C++ advertiser: Intel Parallel Studio Home
Thread Solved

Join Date: Nov 2008
Posts: 24
Reputation: alias120 is an unknown quantity at this point 
Solved Threads: 1
alias120 alias120 is offline Offline
Newbie Poster

Hey all, a little help needed

 
0
  #1
Nov 20th, 2008
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.
  1. #include<iostream>
  2.  
  3. using namespace std ;
  4.  
  5. int main() ;
  6. {
  7. cout << end1 ;
  8. cout << "Hello world." << end1 ;
  9.  
  10. return (0) ;
  11. }
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
Last edited by Narue; Nov 20th, 2008 at 12:15 pm. Reason: added code tags
Reply With Quote Quick reply to this message  
Join Date: Oct 2006
Posts: 2,839
Reputation: niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute 
Solved Threads: 298
Moderator
Featured Poster
niek_e's Avatar
niek_e niek_e is offline Offline
Roasting Maven

Re: Hey all, a little help needed

 
0
  #2
Nov 20th, 2008
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
Last edited by niek_e; Nov 20th, 2008 at 11:28 am.
Reply With Quote Quick reply to this message  
Join Date: Nov 2008
Posts: 24
Reputation: alias120 is an unknown quantity at this point 
Solved Threads: 1
alias120 alias120 is offline Offline
Newbie Poster

Re: Hey all, a little help needed

 
0
  #3
Nov 20th, 2008
oh wow, i feel dumb. Well that makes a lot of sense, i appreciate the response. Ill be sure to use the code-tags.
Reply With Quote Quick reply to this message  
Join Date: Nov 2008
Posts: 43
Reputation: davids2004 is an unknown quantity at this point 
Solved Threads: 0
davids2004 davids2004 is offline Offline
Light Poster

Re: Hey all, a little help needed

 
0
  #4
Nov 20th, 2008
Yea you do not have to use the parentheses around the 0 either after return.

You can just do return 0;
Reply With Quote Quick reply to this message  
Join Date: Nov 2008
Posts: 24
Reputation: alias120 is an unknown quantity at this point 
Solved Threads: 1
alias120 alias120 is offline Offline
Newbie Poster

Re: Hey all, a little help needed

 
0
  #5
Nov 20th, 2008
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.
Reply With Quote Quick reply to this message  
Join Date: Nov 2008
Posts: 24
Reputation: alias120 is an unknown quantity at this point 
Solved Threads: 1
alias120 alias120 is offline Offline
Newbie Poster

Re: Hey all, a little help needed

 
0
  #6
Nov 20th, 2008
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.
Reply With Quote Quick reply to this message  
Join Date: Nov 2008
Posts: 43
Reputation: davids2004 is an unknown quantity at this point 
Solved Threads: 0
davids2004 davids2004 is offline Offline
Light Poster

Re: Hey all, a little help needed

 
0
  #7
Nov 20th, 2008
I made a few changes for you. Good luck with the C++. This website is very helpful.

  1. #include <iostream>
  2.  
  3. using namespace std ;
  4.  
  5. int main()
  6. {
  7. cout << "Hello world." << endl;
  8.  
  9. return 0;
  10. }
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the C++ Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC