| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 3952 人关注过本帖
标题:关于把数字存入数组的问题(就要考试啦啦啦啦。。。)
取消只看楼主 加入收藏
eternuii
Rank: 1
等 级:新手上路
威 望:1
帖 子:27
专家分:0
注 册:2014-10-22
结帖率:83.33%
收藏
 问题点数:0 回复次数:0 
关于把数字存入数组的问题(就要考试啦啦啦啦。。。)
#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
搜索更多相关主题的帖子: function include Enter 
2014-10-25 21:54
快速回复:关于把数字存入数组的问题(就要考试啦啦啦啦。。。)
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.017163 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved