How to make a Turbo C++ Program compatible for CodeBlocks IDE
This is a very general question as most of the coders are working still on Turbo C++ IDE. So here is a simple solution to make your Turbo C++ Program compatible for CodeBlocks IDE.
Let's Consider the following Simple Code of Insertion Sort :-
So, In the above C++ code, In order to make this compatible to CodeBlocks, we have to follow these 6 simple steps :-
1. Replace the header file - #include<iostream.h> with - #include<iostream>
2. Replace the next header file - #include<conio.h> with - using namespace std;
3. Replace the 3rd line - void main() with int main()
4. Remove the 5th line - clrscr();
5. Replace the 2nd last line - getch(); with - return 0;
6. That's all Enjoy
The resultant code will be like this -
Let's Consider the following Simple Code of Insertion Sort :-
So, In the above C++ code, In order to make this compatible to CodeBlocks, we have to follow these 6 simple steps :-
1. Replace the header file - #include<iostream.h> with - #include<iostream>
2. Replace the next header file - #include<conio.h> with - using namespace std;
3. Replace the 3rd line - void main() with int main()
4. Remove the 5th line - clrscr();
5. Replace the 2nd last line - getch(); with - return 0;
6. That's all Enjoy
The resultant code will be like this -
So, In this way we can run most of the C++ codes written in Turbo C++ in CodeBlocks IDE.
Comments
Post a Comment