C++ on Linux not recognizing commands like exit() and printf()
Specifically for ‘exit’ was not declared in this scope
all you need is:
#include <stdlib.h>
In terminal :- when you write man exit :- it will show
exit - cause normal process termination
SYNOPSIS #include stdlib.h
void exit(int status);
so you required to define header #include stdlib.h
Recent versions of GCC have gotten stricter in what responsibilities the programmer needs to fulfill. Include the cstdlib
, cstdio
, etc. header and access these functions from the std
namespace.