Hello , as you might have guessed ,I'm a perfect newbie.C++ is on my high school syllabus and the IDE we are using is Turbo C++ 3.0 on windows xp platform.
They taught us to always begin programs like this as follows...
But as I'm very much interested in programming , I brought a college level text book and also searched the web(including this site),they all tell to do the following things
*do not use .h on header files
*they have "using namespace std" on all programs
*they use several objects/functions such as, for example...
string s1("This is a string");
to create a string..
But the problem is , my IDE is showing tonns of errors for all of these things.It isn't even recognising "using namespace std" and does not find header files without .h.
I am sure that I'm making some big mistake.please advice me.I will be grateful :)
That's because the IDE is ancient. Download MS Visual C++ Express Edition. I would also be very concerned about the C++ course you are taking as it is apparent your instructor is not up to date with the language.
I've noticed that many Indian universities use Turbo C++ and teach deprecated practices, syntax, and technologies in general instead of focusing on standards, proven as well as new technologies.
It's ok, this site will teach you how to shock your teacher into the modern era. I would like to ask you to avoid MS Visual C++ if you don't mind. Plenty of other compilers and IDE's are free and Microsoft products will prevent you from learning things like linking, and it will also make it almost impossible for you to distribute your final program (because of DLL dependencies).
Also the reason that you are told to avoid header files with a ".h" extension is they are generally the older\legacy versions of the header files. Newer header files omit the ".h" and have newer or updated entries. The reason that Turbo C++ 3.0 won't work when you omit the ".h" is that those files aren't in the "include" directory.
EDIT: If you have a brand loyalty to Microsoft then please consider suit their best compiler to date the Windows SDK: http://msdn.microsoft.com/en-us/windows/bb980924 . It isn't an IDE but this thing is fast and powerful and it comes with all of the libraries you need to write Windows Programs.