when I call this function in main, I need to convert the 'longlong num' into string and RETURN the string...
so in main
main()
{
char string[20];
........
string = LongLongToString(random);
}
char LongLongToString(long long num)
{
int counter = 0, i;
char string[20];
while(num !=0)
{
num = num / 10;
counter ++;
}
for(i = counter; i=0; i--)
{
string[counter-1] = num/10;
num = num / 10;
}
string[counter+1] = "\0";
return string;
}
and i have following messege
invalid conversion from 'const char*' to 'char'
invalid conversion from 'char *' to 'char'
address of local variable 'string' returned