Calling an undeclared function is poor style in C (See this) and illegal in C++. So is passing arguments to a function using a declaration that doesn’t list argument types:
If we save the below program in a .c file and compile it, it works without any error. But, if we save the same in a .cpp file, it doesn’t compile.
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.
- NULL undeclared error in C/C++ and how to resolve it
- Difference between Call by Value and Call by Reference
- A C/C++ Function Call Puzzle
- How to call function within function in C or C++
- pipe() System call
- Accept system call
- Wait System Call in C
- Is it possible to call constructor and destructor explicitly?
- dup() and dup2() Linux system call
- Order of Constructor/ Destructor Call in 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++
- exp() function C++
- arc function in C
- log() function in C++
- fma() function in C++
- div() function in C++
- scalbn() function in C++
- tolower() function in C