小编Aks*_*raj的帖子

请告诉我哪里出错了

#include <stdio.h>
main()
{
    char name1[15],name2[15],name3[15];
    int no;

    printf("Enter the serial number and name one\n");
    scanf("%d %15c',&no, name1");
    printf("%d %15s\n\n",no,name1);

    printf("Enter serial number and name two\n");
    scanf("%d %s",&no,name2);
    printf("%d %15s\n\n",no, name2);

    printf("Enter serial number and name three");
    scanf("%d %15s",&no,name3);
    printf("%d %15s\n\n",no,name3);
}
Run Code Online (Sandbox Code Playgroud)

嗨,我是编程的新手,我从C开始是出于某种原因.我上面输入的代码是我想要执行的程序.当我用Code :: Blocks执行它时,它运行直到输入序列号并命名为1然后如果我输入一个数字它就没有响应.然后我尝试使用Visual Studio 2013进行编译,它再次停止响应.

之后我尝试使用Visual Studio 2013调试器进行调试,它在temp.exe中的0x7575B790(msvcrt.dll)上说这是第一次机会异常:0xC0000005:访问冲突写入位置0x00000000.在按下继续之后,它在temp.exe中的0x7575B790(msvcrt.dll)处说这个未处理的异常:0xC0000005:访问冲突写入位置0x00000000. 我在Code :: Blocks之前编写了这个程序,它们都运行良好.请告诉我哪里出错了.另请说明使用%s.

谢谢

c debugging

-2
推荐指数
1
解决办法
127
查看次数

标签 统计

c ×1

debugging ×1