星际医娇txt百度云:请问高手:这个程序错在那里?

来源:百度文库 编辑:高考问答 时间:2024/05/01 03:50:58
// Sample.c
include <stdlib.h>

int main( void )
{
printf("Dev-C++ Sample Program at work!");

system("PAUSE");
return 0;
}

我正在装《21天学通C语言》付送的“Dev-C++编辑器,按书上的方法抄录后仍无法运行,系统一直提示有两处错,可是却看不出来,真是不知所措。提示信息如下:1。 d:\dev_c_~1\untitl~1.c
parse error before `/'
2。8 d:\dev_c_~1\untitl~1.c
parse error before string constant
3。8 d:\dev_c_~1\untitl~1.c
warning: data definition has no type or storage class
对帮助者先说声谢谢了!
现在还剩一个问题:1 d:\dev_c_~1\untitl~1.c
`#include' expects "FILENAME" or <FILENAME>

用到了printf函数,应该在文件包含里加入stdio吧?我猜的,在程序开头加上#include <stdio.h>试试。

include前面漏了一个井(#)号,加上就好啦!

include <stdlib.h>
改成:
#include <stdlib.h>

#include "stdio.h"
#include "windows.h"

//在visual studio 中编译试试```