Use fgets or scanf. Your user will have to specify the form in those cases where the input is ambiguous (e.g. 12345 might be octal, decimal, or hexadecimal, all of which have different values for that set of digits).

You need to decide whether you are programming in C or in C++. They are not the same language. Your error message indicates to me that you have named your file "something.c", which means the compiler will compile it as C. It will not like the string class or C++ I/O (cout, cin).

If you decide to write it as C++, then you will need to change the file's extension. You will also not want to include stdio.h. There's really no reason to include it, since you aren't using an C-style I/O (printf, scanf, fgets, etc.), but if you wanted to use C-style I/O, you would include cstdio, not stdio.h. This places those functions in the standard namespace.

If you were writing anything but a trivial program, you would not want to use "using namespace standard;" That statement brings about lebenty-zillion symbols into your program. With much code at all, you're almost bound to duplicate one and cause yourself much grief.

Getchar is okay, but it's going to leave stuff in the input buffer (a newline, at the very least). That will still be there to plague you on any subsequent input requests. You will have to learn how to get rid of superfluous junk like that.

Personally, I would use fgets to get the entire line. If I were feeling nice, I'd then just take the first character and see if it matched any of the characters I had specified as representatives of a base. If you're specifying that the base be expressed as a number, then if you use getchar you are going to have to collect then convert the input. If you use fgets, then you can use sscanf to collect and convert the input. If your master is telling you not to use any form of scanf, then he/she is telling you that you need to learn how to make your own numerical conversions.

No matter what you use to collect input, always test to see if the input succeeded. Users do not react as you think, they react according to whether they're inattentive, lazy, malicious, or just asleep with their forehead on the keyboard. Failing to test input is the sign of an uninformed person, or a schlock. You are now informed, so there's only one conclusion to draw if you fail to test it hereafter.

The std namespace is a C++ thangy. Don't try to use it in a C program.

First of all, remember to put your own code in code tags, instead of poor Shabbir having to do it. He ain't yo' mama.

What you get from input is going to be a character (multiple characters, actually, a string), not an integer. That's why I mentioned conversions. Give this a shot (note the cases are characters, not integers):