#include <stdio.h>
int main()
{
int a;
int b = 9;
printf("input a integer: ");
scanf("%d",&a);
printf("%d + %d = %d\n",a,b,a+b);
return(0);
}
构建消息:
||=== Build file: "no target" in "no project" (compiler: unknown) ===|
ld.exe||cannot open output file G:\document\C++ and C\Add and Input.exe Permission denied|
||error: ld returned 1 exit status|
||=== Build failed: 2 error(s), 0 warning(s) (0 minute(s), 0 second(s)) ===|
我认为我的代码是正确的。但我无法让它顺利运行。
最佳答案
按照以下步骤使用 CodeBlocks 配置您的项目(在我的例子中,项目名称是“容器”)。
1 - 右键单击您的项目图标:
2 - 选择“用于调试或/和发布的构建选项:”
3-选择“编译器设置”,然后选中与您的选项相对应的框:
关于c - 为什么我不能在代码块中构建和运行它?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59470725/