关于把数字存入数组的问题(就要考试啦啦啦啦。。。)
#include "stdafx.h"int _tmain(int argc, _TCHAR* argv[])
{
char message1[] = "Enter the input: ";
char format[]= "%d"; // format string for the scanf function
int input;
int myarray[5];
_asm{
mov ebx, 0;
lea ebx, myarray;
label1:lea eax, message1;
push eax; //print message1
call printf;
add esp, 4;
lea eax, input;
push eax;
lea eax, format; //read the input
push eax;
call scanf;
add esp, 8
mov eax, input;
add myarray[ebx], eax;
add ebx, 4;
jmp label1;
}
return 0;
}
为什么运行的时候会一直存下去。。。还有为什么会出现Stack around the variable 'format' was corrupt?小女跪求大神帮忙T。T 木有多少分了。。。就这么多了。。。T_T