By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,963 Members | 1,049 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,963 IT Pros & Developers. It's quick & easy.

exit error

P: n/a
faz

Hai,

i have used exit(1) in my code and included conio.h file also but it
is giving the following..
error C2065: 'exit' : undeclared identifier

pls suggest me

regards,
faz

Aug 8 '07 #1
Share this Question
Share on Google+
3 Replies


P: n/a
faz a écrit :
Hai,

i have used exit(1) in my code and included conio.h file also but it
is giving the following..
error C2065: 'exit' : undeclared identifier
Use the following header insted
#include <cstdlib>

Michael
Aug 8 '07 #2

P: n/a
On Aug 8, 5:16 pm, faz <fazulu.v...@gmail.comwrote:
Hai,

i have used exit(1) in my code and included conio.h file also but it
is giving the following..

error C2065: 'exit' : undeclared identifier

pls suggest me

regards,
faz
Depending on the standards you want to comply with (e.g. POSIX, ...),
you might also want to use "exit(EXIT_FAILURE)". Google for details.

Aug 8 '07 #3

P: n/a
On Aug 8, 10:37 am, Michael DOUBEZ <michael.dou...@free.frwrote:
faz a écrit :
i have used exit(1) in my code and included conio.h file also but it
is giving the following..
error C2065: 'exit' : undeclared identifier
Use the following header insted
#include <cstdlib>
In which case he should (according to the current standard) use
std::exit(). For ::exit() (or just plain exit), it's
<stdlib.h>.

(I might add that you generally don't want to use this function
in C++, since it will cause the destructors of local variables
to be skipped.)

--
James Kanze (GABI Software) email:ja*********@gmail.com
Conseils en informatique orientée objet/
Beratung in objektorientierter Datenverarbeitung
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34

Aug 9 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.