You are not logged in. Please login at www.codechef.com to post your questions!

×

Turbo C++ vs. g++(4.8.1)

I have learnt programming in Turbo C++ IDE and now, when i submit my code, the compiler rejects it.

Are the codes written compatible for turbo C++ IDE valid in g++(4.8.1) ?

Is there something i can do to be able to take part in the competitions successfully??

asked 23 May '14, 15:36

nishantgoel's gravatar image

1★nishantgoel
1111
accept rate: 0%

u can go through this link..http://www.codechef.com/getting-started

(23 May '14, 15:41) kunal3614★

Turbo C++ (TCC) is obsolete. Stop using it. The codes written on TCC are not compatible on most modern C++ compilers. For example, in TCC you have to include #include <iostream.h> while on modern compiler it will throw error. You nee to remove the .h to make it compatible. Also using namespace std is alien to TCC but not for modern compilers.
TCC does not support C++11 standard and alone makes a big reason to stay away from this compiler.

link

answered 23 May '14, 15:41

haccks's gravatar image

2★haccks
7624
accept rate: 0%

edited 23 May '14, 18:08

Turbo c++ is an old compiler. It was last updated in 1994-96 but c++ was standardized much later.

But follow the following tips and you will be fine.

1)Replace #include<iostream.h> with #include<iostream>. All c-headers will have a .h extention but c++-headers will not have any extention.

2)Add "using namespace std" before function prototype declaration.

3)Do not use #include<conio.h> and functions like getch(),clrscr().

link

answered 23 May '14, 19:37

dragonemperor's gravatar image

3★dragonemperor
8932933
accept rate: 10%

Turbo c++ is an old compiler. It was last updated in 1994-96 but c++ was standardized much later.

But follow the following tips and you will be fine.

1)Replace #include<iostream.h> with #include<iostream>. All c-headers will have a .h extention but c++-headers will not have any extention.

2)Add "using namespace std" before function prototype declaration.

3)Do not use #include<conio.h> and functions like getch(),clrscr().

link

answered 23 May '14, 19:38

dragonemperor's gravatar image

3★dragonemperor
8932933
accept rate: 10%

toggle preview
Preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported
  • mathemetical formulas in Latex between $ symbol

Question tags:

×1,810
×189
×10
×9

question asked: 23 May '14, 15:36

question was seen: 3,480 times

last updated: 23 May '14, 19:38