I have a string consist of 25bytes concatenate together by 3 different string.
The first string consist max 8 bytes.
If the first string is less than 8 bytes, I want to position it to the right side. I use the command:
sprintf(tmpBuf, "%8.*s", sizeof(8), datapart1);
But when it printed out with all the 3 string, the result is:
"123 2012345 "
The result that I wanted it to be is:
" 1232012345 "
Does anyone know what is wrong with my sprintf statement?
Thank you.
The first string consist max 8 bytes.
If the first string is less than 8 bytes, I want to position it to the right side. I use the command:
sprintf(tmpBuf, "%8.*s", sizeof(8), datapart1);
But when it printed out with all the 3 string, the result is:
"123 2012345 "
The result that I wanted it to be is:
" 1232012345 "
Does anyone know what is wrong with my sprintf statement?
Thank you.