Yes because a program can run without a CPP extension, especially if program extension is .exe
The .cpp extension is merely conventional; it is not required by the C++ standard. You can actually use any file extension you wish.
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.
from the extension of your file.If it has an extension of .cpp then it is a c++ programIf it's extension is .c, then it is a C program.
Yes. cpp is merely a convention to differentiate C++ source code from C source code, just as hpp is used to differentiate C++ header files from C header files (*.h). But they are just conventions, not rules: you can use any extension you like for both header and source files. For example, there's nothing to prevent you using the cpp extension for a header file. However, using the conventions makes it much easier to organise and recognise your files.
what is the pure algorithm instead of cpp program?
find . -iname '*.c' -o -iname '*.cpp'
for c language it is .c and for c++ it is .cpp
In a canonical C compiler, you type "cc (program file name).c (return) and it spits out "a.out", which is an executable. Works with the original Kernighan and Ritchie C compiler. For C++, use the .cpp extension and "g++" for the compiler: In a terminal window, on MacOS, 'cc (program name).c (return)' 'g++ (program name).cpp (return)' produces an executable named "a.out", which can be run. '-o (some file name . extension) will change the output file name.
.h for headers, .cpp or .cc for sources
You would first need to obtain a C compiler. If you know C, you could compose it in Notepad and give it the .c extension (or C++ and give it the .cpp extension) if you wanted to. However, you would need a compiler if you wanted to compile the program and run it.
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.
Answer1. When you save file using extension ".c" the program executes using "C" compiler and it cannot execute any other program which is not in "C".So, we cannot execute program in "C" which is not in "C".2. When you save file using extension ".cpp" the program executes using "C++" compiler and it can execute program of "C" but it should be saved with extension ".cpp".So, There is a program which is not in "C++" can be executed in "C++" compiler.Another answerYour question is ambiguous. 1. Okay in C++ but not in C:int main (void){ cout