c语言错误提示:unexpected end of file while looking for precompiled header directive

   更新日期:2024.04.19
呵呵
你应该是把头文件里面的内容修改了
要不就是编译器出问题了

预编译头出错。你在工程/配置/ [C/C++]/预编译头文件/ 选不使用预编译头

这个问题应该出在头文件 试试#include <iostream>
另外这个程序需要在include之后加using namespace std;否则cout cin都找不到

请问你在问这个问题之前可曾自己搜索过?可曾自己试着解决过?

TO楼上。。不是}的问题。这个是预编译头的问题。

要不就是编译器出问题了

  • 19482471791 :C语言错误error: expected declaration or statement at end of input...
    水文很1681 :答:C语言错误 error: expected declaration or statement at end of input,是代码错误造成的,解决方法如下:1、首先打开Dev C+,如果编写的代码正确,运行时会提示没有错误(Error)和警告(Warning),如下图所示。2、对于 ...
  • 19482471791 :c语言问题:出现'unexpected end of file found”是怎么回事呀?_百度...
    水文很1681 :答:通常是大括号匹配出了问题:意思是:"发现意外的文件结束"end of file就是EOF是传输控制符,在C源文件里要是大括号没有‘’}‘’这个给他匹配完,那么在编译栈里的"{"就不能消去,出现EOF时栈不为空,于是有:'...
  • 19482471791 :C语言错误提示
    水文很1681 :答:谁能提供C语言错误提示的中文解说?越多越越好.越清楚越好.谢了.好的话还有最加分哦... 谁能提供C语言错误提示的中文解说?越多越越好.越清楚越好.谢了.好的话还有最加分哦... 展开  我来答 5...
  • 19482471791 :C语言程序出现错误missing ')' before 'type'
    水文很1681 :答:int main (void){shuru(void); //这一句把void去掉,它只能出现在函数声明中。。zhixing(a);shuchu(a);return 0;}另外好像还有几处错误 int *shuru(void){int i=0,*a1;for(;i<10;i++){scanf("%d",&a...
  • 19482471791 :c语言 error C2143: syntax error : missing '{' befor?
    水文很1681 :答:error C2143: syntax error:missing '{' before '*'这句话的意思是说:C句法规则错误第2143号:在'*'的前面少了'{'。具体要检查在红色标号处(或稍前位置)处有否大括号不匹配的情况。
  • 19482471791 :C语言出现error C2059: syntax error : '%'的错误,怎么解决?
    水文很1681 :答:scanf("%d %d %d",&a,&b,%c);出错了,,应该是:scanf("%d %d %d",&a,&b,&c);并且 printf("a=%f,b=%f,c=%f,s=%f\n",&a,&b,&c,&s);应该是printf("a=%f,b=%f,c=%f,s=%f\n",a,b,c,s...
  • 19482471791 :C语言编程中,调试出现error C2143: syntax error : missing ';' befor...
    水文很1681 :答:错误比较多,你看下边的注释吧,如果还不对请追问,可行望采纳:include <stdio.h>//忘了加头文件 int main(){ int i;double a,b,c,d,e,f,cash;//这2行给你写前面了,具体原因往下看 printf("请输入本月利润...
  • 19482471791 :c语言 error:syntax error before '}' token是怎么回事?
    水文很1681 :答:include<stdio.h> include<math.h> define pi 3.14 int main(){ double r,h,d,s1,s2,v1,v2;r=1.5;h=3;d=2*pi*r;s1=pi*r*r;s2=4*pi*r*r;v1=(4/3)*pi*r*r*r;v2=pi*r*r*h;printf("r=...
  • 19482471791 :c语言程序编程中出现error:';' expected(got "printf")是什么意思?谢...
    水文很1681 :答:去错误信息中的行号和位置处加个 分号 ;想要分号,没找到,找到了printf。你用的什么c编译器,gcc和clang错误信息有区别
  • 19482471791 :C语言程序 数据错误 PE?
    水文很1681 :答:include <stdio.h> int main(){ struct Student { long num;char name[20];int age;float score[7];float all_score;float average;} student[10];int i=0,j=0,k=0;for(i=0; i<10; i++){ scanf("%ld...
  • 相关链接

    欢迎反馈与建议,请联系电邮
    2024 © 视觉网