I cant get my head round this one. Iv been looking around on the net and it seems that the way that people usually do it in c, is to use the sprintf function, my compiler for the PIC does not support such libraries. i was wondering if any one know of how to do it.I managed to get code that converts int to a character string i tested it and it works fine. Id like to have something simialar to it. the code is bellow. Also could any tell me what the line marked with the arrow is doing, especially what it means by the "number%10". Thanks
void func1( int number ) {
int i;
char string[] = "0000000";
for( i = 6 ; number != 0 ; i-- )
string = number%10 + '0'; <---------------------
number = number/10;
}
func2( &string[i + 1] );
}
void func1( int number ) {
int i;
char string[] = "0000000";
for( i = 6 ; number != 0 ; i-- )
string = number%10 + '0'; <---------------------
number = number/10;
}
func2( &string[i + 1] );
}