+ 2

What is the syntax for new line command in c++ ?

12th Aug 2018, 11:19 AM
Ashutosh Divyanshu
Ashutosh Divyanshu - avatar
7 Antworten
+ 5
Agent you are correct but it's used in c.....for c++ new command line will work like this cout<<"hello"<<endl;
12th Aug 2018, 11:38 AM
Yesh Jadav
Yesh Jadav - avatar
+ 6
but Ketan Lalcheta Google baba says endl is known as new command line argument ....and thanks I didn't knew about flush and \n combination
12th Aug 2018, 5:15 PM
Yesh Jadav
Yesh Jadav - avatar
+ 5
i believe it is “\n”
12th Aug 2018, 11:31 AM
Agent
Agent - avatar
+ 5
I would like to differ Yesh Jadav ... one can still use \n in c++.. endl is combination of two different commands (\n and flush)... so, one should choose \n until there is requirement to flush output each time....
12th Aug 2018, 12:23 PM
Ketan Lalcheta
Ketan Lalcheta - avatar
+ 5
thanks alot Ketan Lalcheta
12th Aug 2018, 5:25 PM
Yesh Jadav
Yesh Jadav - avatar
12th Aug 2018, 5:22 PM
Ketan Lalcheta
Ketan Lalcheta - avatar
+ 2
cout<<endl; or cout<<\n;
12th Aug 2018, 7:11 PM
Rakesh Kumar
Rakesh Kumar - avatar