C++ interview questions and pitfalls

Started by
60 comments, last by archon 22 years, 1 month ago
not void.. int
sorry
Advertisement
quote:Original post by PaladinGLT
Adding one to a number w/o +''s or -''s... thats soo easy =P
#include <iostream.h>
void main()
{
int myint=50;
__asm
{
mov eax, myint
add eax, 1
mov myint, eax
}
cout << myint; // will be 51 =)
}


why not
#include <iostream.h>
void main()
{
int myint=50;
__asm
{
add myint, 1
}
cout << myint; // will be 51 =)
}

This topic is closed to new replies.

Advertisement