1
我正在使用Windows 10,TDM-GCC和Eclipse NEON开发工具,该工具在点击运行按钮后无法执行程序,而且我也看不到任何编译后引发的错误消息。它显示非执行程序的Windows 10对话框,其中显示“一个问题导致程序停止正常工作。如果有解决方案,Windows会关闭程序并通知您。”programname.exe在Windows 10中已停止工作对话框
计划,该计划我试图运行 -
#include<stdio.h>
int first;
int second;
int *firstreference;
int *secondreference;
void calledbyvalue(int input);
void calledbyreference(int *input);
void calledbyvalue(int input){
//disabling the buffer
setbuf(stdout, NULL);
printf("Enter the first value - ");
scanf("%d", &input);
printf("Value entered for first is - %d", input);
printf("Entered input is - %d",input);
}
void calledbyreference(int *inputreference){
//disabling the buffer
setbuf(stdout, NULL);
printf("Enter the second value - ");
scanf("%d", &inputreference);
printf("Value entered for second is - %d", inputreference);
printf("Entered input reference value is - %d",&inputreference);
}
void main(){
*firstreference = &first;
*secondreference = &second;
//Calling user defined functions here ....
calledbyvalue(first);
calledbyreference(firstreference);
calledbyvalue(second);
calledbyreference(secondreference);
}
这意味着你的程序崩溃了。您应该在调试器中运行以捕捉崩溃,以查明代码发生的位置。在调试器中,您还可以检查变量的值,以帮助您找出可能导致崩溃的原因。 –
你的代码应该会导致编译器发出很多警告,如果没有,那么你需要改变构建设置。编译器警告通常与编译器错误同样严重,因为它们可能表明您执行了错误操作,导致*未定义行为并在运行时崩溃。 –