C++/visual studio 2008 vs Borland C++5.01!
Expert: Zlatko - 7/10/2010
QuestionHello dear Zlatko;
I'm using Borland C++ 5.01 until now! Now I want to use Microsoft Visual Studio 2008 as compiler. but it seem's some codes is different in it. Is it true? As the first step I see the header files are diffrent in visual studio. I was using these header files in Borland:
#include <iostream.h>
#include <conio.h>
#include <stdlib.h>
#include <math.h>
#include <time.h>
#include <Windows.h>
But it seems these names or Syntax is error in visual studio 2008. Can you help me?
Best regard
Amir
AnswerHello Amir.
The Borland C++ compiler is quite old and the C++ standard has changed since the Borland compiler was made. The standard C++ header files no longer use the ".h" extension. The C++ standard now places all the standard C++ libraries into the std namespace, so you would usually write std::cout, and std::endl. It is common to simply place the line:
using namespace std;
at the top of your C++ file, right after all the header files to avoid specifying std:: throughout the code.
The Borland C++ libraries also have extensions for graphics which you will not have in the Visual Studio so code that uses the graphics will not compile. I don't know if there is a way to link in the graphics libraries.
Best regards
Zlatko