T
trickish
In my main I try to get values assigned to "int *thisSoduko" through
the static method Reader::read.
int main(char *args[])
{
...
int *thisSoduko = new int[1];
if(Reader::read( fileName, delimiter, thisSoduko, size))
{
std::cout << size;
for(int i = 0; i < size; i++)
{
std::cout << "," << thisSoduko;
}
std::cout << std::endl;
}
return 1;
}
in the Reader::read I let the pointer point to a new array with the
desired length:
thisSoduko = new int[size];
and now I store the size number of appropriate integers.
In the end of Reader::read the correct values are stored in
"thisSoduko". This is tested with an equal for-loop as the one seen
here in main. My problem is that the array does not contain the correct
values here.
Where does the pointer / assignment / bring over of values go wrong?
Thanks
TASD
the static method Reader::read.
int main(char *args[])
{
...
int *thisSoduko = new int[1];
if(Reader::read( fileName, delimiter, thisSoduko, size))
{
std::cout << size;
for(int i = 0; i < size; i++)
{
std::cout << "," << thisSoduko;
}
std::cout << std::endl;
}
return 1;
}
in the Reader::read I let the pointer point to a new array with the
desired length:
thisSoduko = new int[size];
and now I store the size number of appropriate integers.
In the end of Reader::read the correct values are stored in
"thisSoduko". This is tested with an equal for-loop as the one seen
here in main. My problem is that the array does not contain the correct
values here.
Where does the pointer / assignment / bring over of values go wrong?
Thanks
TASD