Difference between " ; " and " endl "

0 Kerem Etes · October 7, 2014
I just wanted to ask whats the difference between endl and just ";" on its own. For e.g  when I want to print out a simple text like below which syntax would be correct ?


cout  << "Hello" << endl ; 


or 


cout  <<"Hello" ;




Btw; I'm teaching myself C++ in my spare time and I'm not a industry professional or student so I'm sorry for my derpy questions :)  

Post a Reply

Replies

Oldest  Newest  Rating
0 Kerem Etes · October 8, 2014
Thanks for the replies. Now I got it :)
+2 Samuel Oloruntoba · October 7, 2014
i am not a cpp user, but i studied it for a semester in college, i think endl returns a new line while ";" by itself doesn't
  • 1

C++

107,111 followers
About

Used in many types of software including music players, video games, and many large scale applications.

Links
Moderators
Bucky Roberts Administrator