Courses
Tutorials
Practice
Data Structure
Java
Python
HTML
Interview Preparation
DSA
Practice Problems
C
C++
Java
Python
JavaScript
Data Science
Machine Learning
Courses
Linux
DevOps
SQL
Web Development
System Design
Aptitude
GfG Premium
Similar Topics
Web Technologies
37.4K+ articles
C++
4.3K+ articles
C++ Programs
2.4K+ articles
C Language
1.8K+ articles
School Programming
1.5K+ articles
CPP-Functions
615+ articles
C/C++ Puzzles
187+ articles
C-Functions
87+ articles
return
5+ articles
exit
2+ articles
cpp-main
201+ posts
Recent Articles
Popular Articles
How to call some function before main() function in C++?
Last Updated: 11 March 2023
Since it is known that main() method is the entry point of the program. Hence it is the first method that will get executed by the compiler. But this article explains how ...
read more
C++
Technical Scripter 2019
main
CPP-Functions
cpp-main
How can we write main as a class in C++?
Last Updated: 07 February 2020
As it is already known that main() method is the entry point in any program in C++, hence creating a class named "main" is a challenge and is generally not possible. But t...
read more
C/C++ Puzzles
C++ Programs
C++
School Programming
cpp-main
return 0 vs return 1 in C++
Last Updated: 20 June 2022
The Return statement in C/C++:C and C++ support return statements, which are also called jump statements.It is used to return a value from the function or stop the executi...
read more
Technical Scripter
C++ Programs
Programming Language
C++
return
main
cpp-main
Return Statement vs Exit() in main() in C++
Last Updated: 06 May 2023
The return statement in C++ is a keyword used to return the program control from the called function to the calling function. On the other hand, the exit() function in C i...
read more
C Language
return
exit
cpp-main
C-Functions
Can main() be overloaded in C++?
Last Updated: 16 October 2019
Predict the output of following C++ program.C highllight=12-5 #include iostreamusing namespace std;int main(int a){ cout a \n; return 0;}int main(char *...
read more
C Language
C++
CPP-Functions
cpp-main
Is it fine to write void main() or main() in C/C++?
Last Updated: 17 May 2025
In C/C++ the default return type of the main function is int, i.e. main() will return an integer value by default. The return value of the main tells the status of the exe...
read more
C Language
C++
C Basics
CPP-Basics
CPP-Functions
cpp-main
Difference between "int main()" and "int main(void)" in C/C++?
Last Updated: 19 October 2023
Note: This was true for older versions of C but has been changed in C11 (and newer versions). In newer versions, foo() is same as foo(void).Consider the following two defi...
read more
C Language
C++
C Basics
CPP-Functions
cpp-main
Command Line Arguments in C++
Last Updated: 26 May 2025
Command-line arguments are arguments that are passed to a program when it is executed from the command line or terminal. They are provided in the command-line shell of ope...
read more
C++
Picked
Geeks Premier League
cpp-main
Geeks Premier League 2023
1
2
3
4
...
14
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our
Cookie Policy
&
Privacy Policy
Got It !