Consider the following program. Predict the output of it when compiled with C and C++ compilers.
The above program compiles fine in C, but doesn’t compiler in C++.
In C++, func() is equivalent to func(void)
In C, func() is equivalent to func(…)
This article is compiler by Rahul Mittalal. If you like GeeksforGeeks and would like to contribute, you can also write an article and mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Don’t stop now and take your learning to the next level. Learn all the important concepts of Data Structures and Algorithms with the help of the most trusted course: DSA Self Paced. Become industry ready at a student-friendly price.
- Difference between Call by Value and Call by Reference
- Can we call an undeclared function in C++?
- How to call some function before main() function in C++?
- How to call function within function in C or C++
- pipe() System call
- Accept system call
- Wait System Call in C
- Order of Constructor/ Destructor Call in C++
- dup() and dup2() Linux system call
- Is it possible to call constructor and destructor explicitly?
- A C Puzzle
- A C/C++ Pointer Puzzle
- A Puzzle on C/C++ R-Value Expressions
- A C Programming Language Puzzle
- A nested loop puzzle
- Programming puzzle (Assign value without any control statement)
- Difference between user defined function and library function in C/C++
- Function Overloading vs Function Overriding in C++
- What happens when a virtual function is called inside a non-virtual function in C++
- Difference between Virtual function and Pure virtual function in C++