所以我第一次尝试使用 VS 和 Mac OS Catalina 运行 C 程序但是我在尝试运行时收到以下错误消息:
#include errors detected. Please update your includePath. Squiggles are disabled for this translation unit (/Users/xxx/Documents/EECS2031/scanf2.c).C/C++(1696)
cannot open source file "stdio.h"C/C++(1696)
我在 VS 中使用“Code Runner”扩展来运行 C 代码,并且我还使用自制软件安装了以下内容:
xcode-select --install
brew install gcc
我不确定还能做什么,因为我对 C 完全陌生,并且在搜索后没有找到任何其他解决方案,所以我需要一些帮助。如果有帮助,c 文件名也具有 .c 扩展名。
这是C代码:
#include <stdio.h>
/*The error is here when I am trying to include this library*/
int sum (int i, int j)
{
return i+j;
}
main()
{
int a, b;
printf("Please enter two integers separated by a blank: " );
scanf( "%d %d", &a, &b); /* assign value to a b */
printf("Entered %d and %d. Sum is %d\n", a, b, sum(a,b));
return 0;
}