编写C时,“无法启动程序...系统无法在Visual Studio中找到指定的文件”错误

时间:2017-09-06 04:27:24

标签: c visual-studio

我是C的新手,所以我在Visual Studio上编写了非常基本的代码。第一个程序(Hello World)完美地完成了,但是当我添加第二个程序(循环)时,我得到了

  

无法启动程序,系统无法找到指定的文件

确切错误(出于隐私原因,我在文件路径中添加了3个点)

-----
Microsoft Visual Studio
---------------------------
Unable to start program 'C:\Users ... Learning Projects\Learning\Debug\Learning.exe'.

The system cannot find the file specified.

第一个程序:

#include <stdio.h>
//links the program with the standard input output file
//contains functions like printf 

//main function  
int main() {

    printf("hello World \n");
    return (0);
}

第二个程序:

#include<stdio.h>

int main() {

    int ch; 
    for (ch = 75; ch <= 100; ch++) {
        printf("ASCII value = %d, Character = %c\n", ch, ch); 
    }

    return (0); 
}

这可能是一个愚蠢的问题,但我无法弄清楚导致它的原因。

1 个答案:

答案 0 :(得分:1)

您错误地使用了#include。编译器告诉您它无法找到您希望包含的文件。

当你说

#include "stdio.h""

你应该说

#include <stdio.h>