DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/index.php)
-   C++ (http://www.daniweb.com/forums/forum8.html)
-   -   substitute of semicolon (http://www.daniweb.com/forums/thread32462.html)

SpS Sep 17th, 2005 1:16 am
substitute of semicolon
 
Is it possible to print---- hello world on the screen without using semicolon( ; ) anywhere in the code...i was able to do it through MACROS..but is there anyother way??

Rashakil Fol Sep 17th, 2005 1:23 am
Re: substitute of semicolon
 
MACROS? What does this acronym stand for?

Use an empty while loop.

Dave Sinkula Sep 17th, 2005 1:23 am
Re: substitute of semicolon
 
[Oooooh, when will these questions cease to poison new programmers...?]

Yes. Hone your Googling skills if you are out of hints. [Bonus: Google the groups. Don't make me mention comp.lang.c (ooops!).]

Rashakil Fol Sep 17th, 2005 2:02 am
Re: substitute of semicolon
 
Use a different programming language :)

SpS Sep 17th, 2005 4:05 am
Re: substitute of semicolon
 
Quote:

Originally Posted by Rashakil Fol
Use a different programming language :)


Nice Answer :lol:

SpS Sep 17th, 2005 4:07 am
Re: substitute of semicolon
 
Quote:

Originally Posted by Rashakil Fol
Use an empty while loop.

empty while loop did worked but stuck into infinite loop

while(cout<<"Hello World")
{
}

Paul.Esson Sep 17th, 2005 7:17 am
Re: substitute of semicolon
 
Try

#include <iostream>

int main(){
        while((std::cout << "Hello World"<< std::endl) == 0){}

}

I would assume that like most things cout would return a +ive int if it has success :)


All times are GMT -4. The time now is 3:28 am.

Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC