I have a char * array that holds strings at each index. My problem is the method that actually returns a char * to be stored in that array. Can anyone let me know how to do this in C.
Code:
char *array[MAX]
//i basically want to format a string according to the parameters passed to the function
char * store( int, int, char ch, int, int )
{
char row = { 8, 7, 6, 5, 4, 3, 2, 1 };
char col = { a, b, c, d, e, f, g, h };
char * string;
//I want to do this, but I don't know how to in C, can I use the concatenate function?
string = row[0] + col[0] + " " + ch + " " + row[4] + col[4];
//string = 8a - 4e (would be the result of above )
return string;
}