#include
short getTime()
{
short retval;//short instead of char so the
_asm
{
xor ax,ax//zeros AX out
int 1Ah/calls the clock interrupt
mov BYTE PTR retval,dl//copies DL(the millisecond)
//value to retval
}
return retval;
}
void main()
{
short temp1,temp2;
for(int i=0;i++;i<=20)//for some reason it jumps to the end of the for...
{
temp1 = temp2 = GetTime();//inisialization
while(temp1==temp2)
{
temp2 = GetTime();
}//this way when its displayed theres a different number everytime.
cout << temp2 << ''\n'';
}
}
I came, I saw, I got programmers block.
~V''lion
Fragging asm !
~V'lionBugle4d
Hi.
Should not the following statement:
for(int i=0;i++;i<=20)//for some reason it jumps to the end of the for...
read like this instead?:
for(int i=0;i<=20;i++)//for some reason it jumps to the end of the for...
Topgoro
Should not the following statement:
for(int i=0;i++;i<=20)//for some reason it jumps to the end of the for...
read like this instead?:
for(int i=0;i<=20;i++)//for some reason it jumps to the end of the for...
Topgoro
We emphasize "gotoless" programming in this company, so constructs like "goto hell" are strictly forbidden.
This is simple C man. Exactly what the last poster said!
for(assignment, expression, assignment (usually increment/decrement) ) is the syntax.
=======================================
A man with no head is still a man.
A head with no man is plain freaky.
for(assignment, expression, assignment (usually increment/decrement) ) is the syntax.
=======================================
A man with no head is still a man.
A head with no man is plain freaky.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement