I just installed a compiler, and I wanted to know if I installed the C and the C++ compiler, or only the C compiler.
The answer is simple : let's use small sample programs.
Everybody know the well-known "hello" world C program, it compiles with a standard C compiler.
CODE
main ()
{
printf("Hi, Folks, what s new");
}
{
printf("Hi, Folks, what s new");
}
And here is a sample C++ "hello world" program :
CODE
#include <iostream.h>
main()
{
cout << "Hello World!";
return 0;
}
main()
{
cout << "Hello World!";
return 0;
}
The second sample program compiles only with a C++ compiler, the standard C compiler gives an error for the "cout" syntax.
So, using these two small pieces of code allows you to check that you have both the standard C and the C++ compilers.
Hope this helps you as it helped me.
Regards
Yordan


