clrscr
is not part of the C++ standard. This means that the function is not guaranteed to come with your compiler (and indeed, you should assume it doesn't). Turbo C++ is a very old compiler that came with a lot of non-standard things (in fact, it's so old that back then there
was no standard).
Now that you are using a more modern compiler (well, I assume you are - the Code::Blocks IDE usually comes with a pretty recent compiler) you will have to use standard C++.
If you insist on clearing the console, pick something out of this article:
http://www.cplusplus.com/articles/4z18T05o/
Also:
1 2 3
|
#include<stdio.h>
#include<string.h>
#include<conio.h>
|
Please don't ever ever use any of these headers in C++ (or at least until you know what you're doing and have a really good reason to). The first one has been replaced with cstdio, the second one with cstring (and frankly, since this is C++, you shouldn't be using C-strings unless you have to, and you don't have to for this), and conio.h is horribly non-standard and this code will not work at all on many modern systems.
printf? No thank you. This is C++. Use
#include <iostream>
and
cout
.
gets? Similarly horribly and very dangerous. Use
cin
.
Whatever you're using to learn C++. please stop. Throw it away. Find something from the last decade.