I try to put value of two integers into char array. If I have:
x = 3;
y = 5;
then I want to have
links[0][0] = "3,5";
I have this code now, but I don't know how can I continue.
char** links = (char**) calloc(SRTM_SIZE, sizeof(char*));
if(links)
{
for(int i = 0; i < SRTM_SIZE; i++)
{
links[i] = (char*)calloc(SRTM_SIZE, sizeof(char));
//memset(links[i], 0, sizeof(*links[i] * SRTM_SIZE));
}
}
x = strtok(temp, ",");
y = strtok(NULL, ",");
int xx = atoi(x);
int yy = atoi(y);
//Some calculation with x and y and if it's okay, then I need to put value of x and y to array, but I don't know how
printf("%s\n", links[0][0]);
edited:
What exactly I need is matrix (propably 1201x1201) of strings. Into cells (not into all, but propably into most of them) I need put string values. This values can be from "0,0" to "1200, 1200". And later in program I need to acces to all cells with strings values, because each value is position of one of adjacent cells.