You are here:

C++/visual studio 2008 vs Borland C++5.01!

Advertisement


Question
Hello 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

Answer
Hello 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

C++

All Answers


Answers by Expert:


Ask Experts

Volunteer


Zlatko

Expertise

No longer taking questions.

Experience

No longer taking questions.

Education/Credentials
No longer taking questions.

©2012 About.com, a part of The New York Times Company. All rights reserved.