Funny programming pictures, jokes & quotes
The funny part was supposed to be the mushrooms.... nevermind.
I guess i should have said that he is 14.
I guess i should have said that he is 14.
irrRenderer 1.0
Height2Normal v. 2.1 - convert height maps to normal maps
Step back! I have a void pointer, and I'm not afraid to use it!
Height2Normal v. 2.1 - convert height maps to normal maps
Step back! I have a void pointer, and I'm not afraid to use it!
Hello World? Need vacation
Dustbin::Games on the web: https://www.dustbin-online.de/
Dustbin::Games on facebook: https://www.facebook.com/dustbingames/
Dustbin::Games on twitter: https://twitter.com/dustbingames
Dustbin::Games on facebook: https://www.facebook.com/dustbingames/
Dustbin::Games on twitter: https://twitter.com/dustbingames
Code: Select all
a:
goto a
I think it will get into an infinite loop.
Just a wild guess . It does, however, almost look as good as the "hello world" of Brainfuckkazymjir wrote:Brainsaw, are you sure?
Dustbin::Games on the web: https://www.dustbin-online.de/
Dustbin::Games on facebook: https://www.facebook.com/dustbingames/
Dustbin::Games on twitter: https://twitter.com/dustbingames
Dustbin::Games on facebook: https://www.facebook.com/dustbingames/
Dustbin::Games on twitter: https://twitter.com/dustbingames
-
- Admin
- Posts: 14143
- Joined: Wed Apr 19, 2006 9:20 pm
- Location: Oldenburg(Oldb), Germany
- Contact:
No, that's an incomplete answer. The thing is that the output of this function was searched. It's also called _tmain, which will probably also not link without a proper main(). But you could still define the output of this function in case it's called (which would also require that it's properly linked before).
Put aside all the sophistry and it actually says "Hello World"
Code: Select all
#include <stdio.h>
int main()
{
char* p=new char[12];*p=0x48;++p;*p=0x65;++p;*p=0x6c;
++p;*p=0x6c;++p;*p=0x6f;++p;*p=0x20;++p;*p=0x57;++p;
*p=0x6f;++p;*p=0x72;++p;*p=0x6c;++p;*p=0x64;++p;
*p=0x0;--p;--p;--p;--p;--p;--p;--p;--p;--p;--p;--p;
printf(p);
delete p;
return 0;
}
Never take advice from someone who likes to give advice, so take my advice and don't take it.
_tmain is used in VC++. _t* functions is calling ANSI functions if _UNICODE isn't defined. If _UNICODE is defined, it's calling UNICODE version of that function.hybrid wrote:It's also called _tmain, which will probably also not link without a proper main().
So everything is ok, proper main will be called (main if ANSI, wmain if UNICODE).
But, there don't even must be main() function. Why?
Because, compiler is working always first. If compiler found error in code, it will not run linker.
So, output will be an error that printf() function is not found.
Linker will be not called, because of error found by compiler in code
Last edited by kazymjir on Wed Feb 09, 2011 9:31 am, edited 1 time in total.
Here is my optimized version:
Code: Select all
#include <stdio.h>
int main() {
char *p=new char[13];
*p++=0x48;*p++=0x65;*p++=0x6c;*p++=0x6c;*p++=0x6f;
*p++=0x20;*p++=0x57;*p++=0x6f;*p++=0x72;*p++=0x6c;*p++=0x64;*p++=0x0A;*p=0;
--p;--p;--p;--p;--p;--p;--p;--p;--p;--p;--p;--p;printf(p);return 0;
}
Dustbin::Games on the web: https://www.dustbin-online.de/
Dustbin::Games on facebook: https://www.facebook.com/dustbingames/
Dustbin::Games on twitter: https://twitter.com/dustbingames
Dustbin::Games on facebook: https://www.facebook.com/dustbingames/
Dustbin::Games on twitter: https://twitter.com/dustbingames
Let's do more optimization!
Code: Select all
int main() {
char *p=new char[13];
*p++=0x48;*p++=0x65;*p++=0x6c;*p++=0x6c;*p++=0x6f;
*p++=0x20;*p++=0x57;*p++=0x6f;*p++=0x72;*p++=0x6c;*p++=0x64;*p++=0x0A;*p=0;
--p;--p;--p;--p;--p;--p;--p;--p;--p;--p;--p;--p;
__asm__("\
movl $4, %%eax\n\
movl $0, %%ebx\n\
push %0\n\
pop %%ecx\n\
movl $13,%%edx\n\
int $0x80" : :"g"(p)); return 0;
}