1st Program in Turbo C++

cpp

As we know Turbo C++ (Non ANSI C++) has some different syntax than ANSI C++.

So we have to do some modification in every program of ANSI C++.

According to ANSI C++ header files have no extension like “#include<iostream>” . But we have to use “#include<iostream.h>” .

ANSI version has “using namespace std;” but we have to use “#include<conio.h>” instead of “using namespace std;” .

In ANSI C++ all programs have main function with int return type i.e. “int main()” but we have to use “void main()” . Therefore there is no need to add “return 0;” in the program.

But we have to use “getch();” in every program as the last statement to freeze the screen.

There is no “getch();” in any program of ANSI C++ because there is “using namespace std;” .

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *