Reputation: 402
I am getting two unresolved externals error while trying to compile the following c++ program in Visual Studio 2010- http://codepad.org/5ZS4gtfP
I tried cross checking everything but cant seem to find the problem. Can someone plz compile it in VS 2010 and try to find out the solution?
Upvotes: 0
Views: 405
Reputation: 882376
For a start, conio.h
is not standard C or C++ - it tends to be found in code written for the Turbo C/C++ products, a particular favourite of Indian universities.
And they invariably use it just so they can call getch
when there's a perfectly adequate getchar
in the standard :-)
As to the index
variable, it's probably already defined in one of the headers.
Upvotes: 3
Reputation: 273726
Try to include <conio.h>
instead of "conio.h"
.
It could be that one of the headers you're including already declares index
. Try to rename it to see the difference - or better yet don't use a global variable at all.
Upvotes: 0