I have started learning C++ for my programming class. I have downloaded this \"Hello World\" program:
#include
using namespace std;
int mai
There's no problem with this program. (Except probably some stylistic issues —
using namespace std
is not recommended). The problem is with Turbo C++. It is a very old piece of software. It implements a dialect of C++, so-called pre-ANSI C++, that has completely fallen out of use by the beginning of this millennium. The first ANSI standard for C++ was published in 1998, then there was the 2003 version, the 2011 version, the 2014 version, the 2017 version, and now we expect the 2020 version to be officially published. Each of these standard revisions brought more or less significant changes to the language.
For Turbo C++ you have to modify the program like this:
#include // note the .h suffix
// using namespace std; // Turbo C++ doesn't implement namespaces
int main()
{
cout << "Hello, World!";
return 0;
}
If you look at this program, the difference between the modern C++ dialect and the one accepted by Turbo C++ may seem small. However it will grow much larger as your programs will be getting more complex.
While you can learn programming using Turbo C++ I would strongly recommend to avoid that if humanly possible because of the following problems:
There are many modern free (as in beer, as well as in speech) compilers and IDEs you can use in place of Turbo C++. Some of these include:
Regrettably, some schools/teachers appear to force students to use Turbo C++ even in this day and age. Unfortunately this is not something this community can fix. If you find yourself in this situation, prepare to not being able to get much outside help.