I had recently started using Dev C++ 5.4 (earlier I was using Turbo C++ 3.0). Suggest me some good books to start programming in windows. And also my old programs which I had made in Turbo C++ are not compiling successfully. Fstream.h, iomanip.h and graphics.h are not not working in this. Help me.

Recommended Answers

All 4 Replies

Your old programs are written in C++ from before 1998. Fifteen years.

To fix them, I expect you need to learn how C++ standard library headers are named now (they do not have the .h on the end) and you need to learn about namespace.

Member Avatar for iamthwee

Anything written in that antiquated turbo c is pretty much non standard b.astardized c++ anyway.

The solution is simple your programs won't work on anything but turbo c so your only choice is to carry on using it. Turbo c is actually an okayish choice for NEWBIES if you intend to use it for graphs because you don't have to add any libs. It's ready from the get go.

If you want modern day stuff you're gonna have to practically re-learn C++ and use a graphics library.

Not sure what's the popular choice nowadays but it used to be SDL/allegro/ncurses and perhaps even openGL.

Turbo c is actually an okayish choice for NEWBIES if you intend to use it for graphs because you don't have to add any libs. It's ready from the get go.

I'd like to politely disagree with this on the grounds that learning antiquated equipment makes you really good at using antiquated equipment. If at some point you'd have to relearn something modern, just start with something modern. It's all available for free.

The solution is simple your programs won't work on anything but turbo c so your only choice is to carry on using it.

Well, another solution is to make all the necessary changes to the code so that it works on a modern compiler. If the project is not too big, this can be a very good way to unlearn all the non-standard stuff you might have learned over time while using this ancient compiler.

Fstream.h, iomanip.h and graphics.h are not not working in this. Help me.

fstream.h and iomanip.h are not called just fstream and iomanip, i.e., you write #include <fstream> and #include <iomanip>. The standard C libraries (math.h, stdlib.h, etc..) have a different name in C++, they are now cmath, cstdlib, etc.. without the .h. Also, all standard classes and functions are now in the std namespace, meaning that cout is now std::cout, ifstream is now std::ifstream and so on, and if you want to avoid having to write std:: everywhere, you write using namespace std; either at global scope (outside any function) or within the function where you want to avoid writing std::.

As for graphics.h, this is not a standard library, only a Windows-specific library. This library has been long since deprecated and is no longer bundled with any compiler, as far as I know.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.