is there anyway to print out any string on stdout without using semicolon at the end... ?? plzz reply
harshchandra
-3
Junior Poster in Training
Recommended Answers
Jump to PostI have no idea what you just asked. Be more specific.
Jump to PostOh, is this the "hello world without a semicolon" problem with a C++ twist?
#include <iostream> int main() { if ( std::cout<<"Hello, world!"<<std::endl ) { } }
Jump to Postthat can't be correct, Na I thought you told me int main() has to return something? Nothing was returned :evil:
hahahaha...seriously, don't you have to put something inside the braces?
Jump to Post>Nothing was returned
Standard C++ returns 0 by default. Returning from main can be tricky, especially if you switch languages and work with legacy code a lot. In pre-standard C++ you need to explicitly return a value. In C89 you need to explicitly return a value. In standard C++ and …
Jump to Postis there anyway to print out any string on stdout without using semicolon at the end... ?? plzz reply
If you want to just output anything without semicolon at the end ...then u can simply shift the semicolon to the next line i.e
1.printf("hello world")
2.; // semicolon is …
All 21 Replies
Narue
5,707
Bad Cop
Team Colleague
harshchandra
-3
Junior Poster in Training
Narue
5,707
Bad Cop
Team Colleague
harshchandra
-3
Junior Poster in Training
Fasola
0
Junior Poster
Narue
5,707
Bad Cop
Team Colleague
koder
0
Newbie Poster
iTaChi
19
Newbie Poster
~s.o.s~
2,560
Failure as a human
Team Colleague
Featured Poster
Narue
5,707
Bad Cop
Team Colleague
ranjani
-2
Newbie Poster
Salem
5,138
Posting Sage
ranjani
-2
Newbie Poster
Salem
5,138
Posting Sage
Narue
5,707
Bad Cop
Team Colleague
gopi kannan
-2
Newbie Poster
findsyntax
-6
Newbie Poster
Narue
5,707
Bad Cop
Team Colleague
Nick Evan
4,005
Industrious Poster
Team Colleague
Featured Poster
Narue
5,707
Bad Cop
Team Colleague
Nick Evan
4,005
Industrious Poster
Team Colleague
Featured Poster
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.