Code: Select all
error C2664: 'atoi' : cannot convert parameter 1 from 'char' to 'const char *'
1>Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast
Here is the relevant code to my issue.
Code: Select all
class Board
{
private:
int *board; //Pointer to the board in 0x88 method...Or, a
dynamically created array
public:
Board()
{
this->board = new int[128]; //dynamically creates the
array
}
InputFEN(string fen)
do something;
default:
squareindex += atoi(fen[i]); //Where compiler says the
code fails
};
fen is a string, and fen is how I keep track of where I am in the string.
This is the point where I am taking into account the numbers in the position part of the string.
How do I solve this problem?
Thanks in advance.
P.S. I have Microsoft Visual Studio 2008 Professional as a compiler.