Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
void foo(unsigned char *dst, const int *src, size_t size)
{
while ( size-- )
{
*dst++ = *src++;
}
}
If you want a number like 100 to be an array of 3 chars "100", that won't work.ezeke1 said:I wanted the char array to contain the text format of each integer
#define SIZE 50
int main()
{
int i;
int a[ SIZE ] = {...}; /* Max int size of 100 */
char temp[ 4 ];
char str[ (SIZE * 3) + 2 ];
memset( str, '\0', sizeof( str ) );
for ( i = 0; i < SIZE; ++i )
{
sprintf( temp, "%d", a[ i ] );
strcat( str, temp );
strcat( str, " " );
}
}