编译说'sleep' : undeclared identifier,求救
使用vc,做一个console程序,想用sleep()函数来暂停一下,编译通不过,
于是用如下简单的程序来试一下,还是不行。
#include "stdafx.h"
#include <dos.h>
#include <stdio.h>
int main(void)
{
sleep(1000);
}
编译说'sleep' : undeclared identifier。sleep()究竟要怎么用啊?
问题点数:100、回复次数:12Top
1 楼opentuxedo(借哥哥的号来试试)回复于 2002-05-20 11:20:22 得分 5
Sleep(1000);Top
2 楼feng_sky(日三而省.)回复于 2002-05-20 11:22:23 得分 5
Sleep();Top
3 楼GreenER(马二)回复于 2002-05-20 11:23:04 得分 10
呵呵,那在C语言中可以的
注意大写啊,我以前也出过错的。Top
4 楼adams791001(土豆)回复于 2002-05-20 11:25:12 得分 15
编译的意思是说你没有定义这个名字'sleep';
你查看一下你的大小写是否完全正确,同时看看在程序的开头又没有定义这个成员函数,同时还得指出它的作用域,还有救是看看定义它的时候类的大小写对不对。
最后看看程序开头是否包含了这个函数所属类的引用"#include "类名.h".
希望你能编译通过Top
5 楼cadinfo(无语清风)回复于 2002-05-20 11:25:27 得分 5
使用如下函数
void _Sleep( long msSleep )
Top
6 楼jaidy(骑士)回复于 2002-05-20 11:25:51 得分 5
就是,vc对大小写很注意
你的外号很不错嘛!:-)Top
7 楼harry202(harry)回复于 2002-05-20 11:26:27 得分 10
大哥,S大写。。。你怎么不用msdn查一下再问呀。。。晕到Top
8 楼cadinfo(无语清风)回复于 2002-05-20 11:27:41 得分 15
This command tells the system to sleep the specified amount of time.
void _Sleep( long msSleep )
Top
9 楼qiuanhong(练从难处练,用从易处用)回复于 2002-05-20 11:28:42 得分 15
工作上一丝不苟,生活上一丝不挂):
呵呵~~~~~~~~~~~~~~
注意啦:在VC++中,一定要注意大小写
把
sleep(1000);
改为
Sleep(1000);
就可以了
Top
10 楼feng_sky(日三而省.)回复于 2002-05-20 11:29:00 得分 10
挂上大写的S就可苟合了!
*_*Top
11 楼hwf962709()回复于 2002-05-20 14:45:09 得分 0
呵呵,该一下大小写就可以了,真是谢谢大家Top
12 楼Q_O()回复于 2002-05-20 14:49:47 得分 5
SleepTop
相关问题
- 用PlaySound()播放wave文件,编译时提示:undeclared identifier?
- T2W(LPTSTR lp)为什么编译时报错:_lpa undeclared identifier?
- 加了#include <Dshow.h> 编译报strcpy_instead_use_StringCbCopyA_or_StringCchCopyA' : undeclared identifier
- Delphi2005初次使用,编译时提示E2003 Undeclared identifier: 'Move'
- 编译全局钩子DLL时报错:error C2065: 'glhHook' : undeclared identifier
- CoInitializeEx在release 版本编译报错 :undeclared identifier
- 为什么vc6使用InterLockedExchangePointer,编译不通过提示undeclared identifier
- 调用FindFirstVolume编译错误是undeclared identifier,怎么回事?
- 为什么我的使用CopyFileEx函数时编译提示undeclared identifier??
- 为什么excel的图标类型ChartType用在delphi里,编译会说“Undeclared Identifier”?




