|
***1000***
*** 1000***
***1000 ***
***001000***
|
char szBuffer[512];
int a;
a = 1000;
wsprintf( szBuffer, "***%d***", a );
printf( "%s\n", szBuffer );
wsprintf( szBuffer, "***%6d***", a );
printf( "%s\n", szBuffer );
wsprintf( szBuffer, "***%-6d***", a );
printf( "%s\n", szBuffer );
wsprintf( szBuffer, "***%06d***", a );
printf( "%s\n", szBuffer );
| |
|
|
|
***3e8***
*** 3e8***
***3e8 ***
***000003e8***
*** 0x3e8***
***0x000003e8***
***0X000003E8***
***0x000003E8***
|
char szBuffer[512];
int a;
a = 1000;
wsprintf( szBuffer, "***%x***", a );
printf( "%s\n", szBuffer );
wsprintf( szBuffer, "***%8x***", a );
printf( "%s\n", szBuffer );
wsprintf( szBuffer, "***%-8x***", a );
printf( "%s\n", szBuffer );
wsprintf( szBuffer, "***%08x***", a );
printf( "%s\n", szBuffer );
wsprintf( szBuffer, "***%#8x***", a );
printf( "%s\n", szBuffer );
wsprintf( szBuffer, "***%#08x***", a );
printf( "%s\n", szBuffer );
wsprintf( szBuffer, "***%#08X***", a );
printf( "%s\n", szBuffer );
wsprintf( szBuffer, "***0x%08X***", a );
printf( "%s\n", szBuffer );
| |
|
|
|
***abcd***
*** abcd***
***abcd ***
***0000abcd***
|
char szBuffer[512];
char *a;
a = "abcd";
wsprintf( szBuffer, "***%s***", a );
printf( "%s\n", szBuffer );
wsprintf( szBuffer, "***%8s***", a );
printf( "%s\n", szBuffer );
wsprintf( szBuffer, "***%-8s***", a );
printf( "%s\n", szBuffer );
wsprintf( szBuffer, "***%08s***", a );
printf( "%s\n", szBuffer );
| |
|
|
|