C++ likes URLs

Posted on:June 22 2009

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 :)





Comments:


Yay! Code obfuscation: "goto http"
kieni
Quote
2009-06-22 17:15:00


That is fantastic. :D
Fortyseven
Quote
2009-06-22 19:18:00


fount at stackoverflow ?
Jyaif
Quote
2009-06-22 19:57:00


lol!! Cool..
MasterGod
Quote
2009-06-22 23:17:00


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
Quote
2009-06-23 02:15:00


Lol ... I think I'll have to add that at work ;)
Brainsaw
Quote
2009-06-23 07:19:00


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
Quote
2009-06-23 17:56:00


looks like the floodgates broke
sRc
Quote
2009-06-27 01:41:00


lol, that is awesome.

~DtD
DtD Software
Quote
2009-06-30 18:50:00


Add comment:


Posted by:


Enter the missing letter in: "?nternational"


Text:

 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons