Functions have several purposes. Every program must have at least one global function named main. Although it is possible to write entire programs using this one function, this is only practical with extremely trivial applications, such as the "Hello World" application:
int main()
{
cout << "Hello world!";
}
As programs become more and more complex, however, we need to break the program down into much simpler problems, such that our main function actually does very little work. Typically, the main function does nothing more than call a function to process the command line arguments (and act upon them), wrapping that call in a catch-all exception handler.
The command line processing function itself will invoke an appropriate function according to the command line arguments, and thus becomes an elaborate switch statement.
Complex functions are difficult to read and maintain, but can be simplified by separating the code into a series of function calls, such that each function's name essentially describes what it does. Thus programs become self-documenting.
In C++, classes would be useless without functions (or methods as they are known).
The .cpp extension is merely conventional; it is not required by the C++ standard. You can actually use any file extension you wish.
for c language it is .c and for c++ it is .cpp
find . -iname '*.c' -o -iname '*.cpp'
Oh, dude, converting a CPP API to a flat C API? That's like asking how to turn a sports car into a go-kart. You basically just strip away all the fancy features, bells, and whistles of C++, and leave it with the bare minimum in C. It's like going from a gourmet meal to a plain ol' PB&J sandwich. Just take out the C++ stuff and simplify it down to C - easy peasy, lemon squeezy.
The extension of a file containing a C program can be any extension, so long as the compiler or platform can infer the proper rules to build it. Commonly, for C programs, the extension is .c, so myfile.c would be a C program. The term cpp is not a designation for C++. It means C Program Precompiler, and it is the normal way to build one or more C programs into an executable. Over the years, cpp has evolved into being able to handle all sorts of languages. C++ is one of them. Typical extensions for C++ programs are .cc, .cpp, and .cxx.
All C++ source code is is a text file with the .cpp extension. So if you save your code as *****.cpp then it is automatically C++ source code.
That is possible. Try it.
Different architecture on different platforms.
C++ first appeared in 1983.
The major advantage of C++ over C is the Object Oriented Programming compatibility in C++.
No, C++ is not a strict OOP language as like Java and C#. C++ supports all OOPS concept like Encapsulation, Polymorphism, Inheritance etc. But C++ provides a way to expose the private data to outside world using friend functions, which is a violation of OOPS.
CPP typically stands for the C PreProcessor, which does macro expansion on C source code. What I suspect you want to know are the differences between C++ and Java. See the links below for more information on that topic.