标题:Unhandled exception in .exe:0xc0000005: Access Violation
只看楼主
vfdff
Rank: 6Rank: 6
等 级:侠之大者
威 望:8
帖 子:2172
专家分:425
注 册:2005-7-15
结帖率:79.17%
已结贴  问题点数:10 回复次数:1 
Unhandled exception in .exe:0xc0000005: Access Violation
int main(0
{
.....


return 0;
 }
单步调试时在return 0;后出来一个错误
Unhandled exception in .exe:0xc0000005: Access Violation
这是为什么呢 ?
搜索更多相关主题的帖子: Unhandled exception 0xc0000005 Access Violation 
2009-08-25 17:48
vfdff
Rank: 6Rank: 6
等 级:侠之大者
威 望:8
帖 子:2172
专家分:425
注 册:2005-7-15
得分:0 
查明是定义和说明不一致赵成的,C语言语法检查不严格
定义了
void ctostr(unsigned char c, char* str,int *a)
{
    int i;
    *a = 1110;
    for (i = 7; i >= 0; i--)
    {
        if((c & (1<<i)) >> i)
            str[7-i] = '1';
        else
            str[7-i] = '0';
    }
   
    str[8] = 0;
}
却说明为 void ctostr(unsigned char c, char* str);
结构在 使用时只用了2个参数!
int   main()   
{   
     char str[8];

    ctostr(123, str);   // 使用
    return   0;   
}

~~~~~~~~~~~~~~~好好学习~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2009-08-26 00:33



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-283682-1-1.html




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

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