+ 3
Terminate a c++ program
how can I terminate a c++ programme when a condition is met
6 ответов
+ 3
found it
we can use stdlib.h and exit(0);
yeeaaahhhhh!
+ 3
oh!!!
thnq very much @yash
and @frederic sry I didn't got u
U were right
I thought that (return 0) can only be used at the end of a program...
thnx guys
+ 2
the proper way to terminate your main function is
return 0;
+ 2
@dhiman I think I already found it (the very first ans Of this question)
btw thnx for ur help
+ 1
no, I was asking :- how to terminate the entire code when a specific condition is met without running the code after that condition
0
You can use exit () which is defined in the library function stdlib.h
Hope i was clear enough