C++ likes URLs

One of the most useless thing I learned today: You can write URLs directly into C++ source, like
void foobar()
{
http://www.irrlicht3d.org
int k = baz();
}
The http: is recognized as a label and the // + following characters is simply a comment.
Senseless but cool :)

nine comments, already:

Yay! Code obfuscation: “goto http”
kieni - 22 06 09 - 17:15

That is fantastic. :D
Fortyseven (link) - 22 06 09 - 19:18

fount at stackoverflow ?
Jyaif - 22 06 09 - 19:57

lol!! Cool..
MasterGod (link) - 22 06 09 - 23:17

That’s so funny… I can see programmers looking at that code and wondering what the hell it does. Without knowing why it was there (stupid parlor trick) I’d be too nervous to change it…. I’d be worried about breaking it!
Michael - 23 06 09 - 02:15

Lol … I think I’ll have to add that at work ;)
Brainsaw (link) - 23 06 09 - 07:19

Yes, it works… looks funny too…

int main( void )
{
int i = 1;

http://www.domain.tld

if ( i++ < 5 )
goto http;//www.domain.tld
else
goto ftp;//ftp.domain.tld

ftp://ftp.domain.tld

return 0;
}
kieni - 23 06 09 - 17:56

looks like the floodgates broke
sRc - 27 06 09 - 01:41

lol, that is awesome.

~DtD
DtD Software (link) - 30 06 09 - 18:50


Displayed name:  
Remember personal info?
yes
no
Website (optional):
Enter "layered" (antispam):
Comment:Emoticons / Textile

 


Small print: All html tags except <b> and <i> will be removed from your comment. You can make links by just typing the url or mail-address.
Note: If you type in your email adress above, it will be visible to other visitors, although it will be hidden for bots using javaScript.