Roma
Roma

Reputation: 19

Compiler does not allow to use exit() function in C

I am doing an online course in programming, And I've got assignment to complete, So my problem is I'm not able to use exit(0); in this online compiler, I dont know which compiler is this, however the course is powered by Google.

Whatsoever, the error i get is :

Program:18:1: warning: implicit declaration of function 'exit' [-Wimplicit-function-declaration]
Program:18:1: warning: incompatible implicit declaration of built-in function 'exit' [enabled by default] 

So I'm helpless, It works fine in other compilers , ie DEV c++ and turbo c++ , So can anyone help me please!

Upvotes: 1

Views: 344

Answers (1)

cnicutar
cnicutar

Reputation: 182774

You need to include stdlib.h for exit.

Upvotes: 5

Related Questions