print the given number with spaces in between each number?
void stringwhitesp(c har *string, char *whitesp)
{
char c='0';
for (c=0; *(string+c)<='\ 0';c++)
{
*(whitesp + (c*2)) = *(string + c);
*(whitesp + (c*2) + 1) = ' ';
}
*(whitesp + (c*2)) = 0;
}
/**@brief Function for application main entry.
*/
//char string[MAX_SIZE];
char * pointer;
char num[] = {10,1,50,30,3,8 ,62,15,15,4};
char one[20];
int main(void)
{
bool erase_bonds;
// Initialize.
log_init();
timers_init();
// Start execution.
stringwhitesp(n um, one);
NRF_LOG_INFO("n um %d\n",NRF_LOG_P USH (num));
NRF_LOG_INFO("o ne %s\n",NRF_LOG_P USH (one));
// Enter main loop.
for(;;)
{
idle_state_hand le();
}
}
void stringwhitesp(c har *string, char *whitesp)
{
char c='0';
for (c=0; *(string+c)<='\ 0';c++)
{
*(whitesp + (c*2)) = *(string + c);
*(whitesp + (c*2) + 1) = ' ';
}
*(whitesp + (c*2)) = 0;
}
/**@brief Function for application main entry.
*/
//char string[MAX_SIZE];
char * pointer;
char num[] = {10,1,50,30,3,8 ,62,15,15,4};
char one[20];
int main(void)
{
bool erase_bonds;
// Initialize.
log_init();
timers_init();
// Start execution.
stringwhitesp(n um, one);
NRF_LOG_INFO("n um %d\n",NRF_LOG_P USH (num));
NRF_LOG_INFO("o ne %s\n",NRF_LOG_P USH (one));
// Enter main loop.
for(;;)
{
idle_state_hand le();
}
}
Comment