If you have made data statistics in VC ProgramYou will find that alignment that was originally used to control character output in cmd does not seem to be applicable in VC.
Use printf ("% 8d", I) in cmd to output a right-aligned integer. If the number of digits is not enough, just fill the space, but use textout () in VC () in this way, when formatted string objects are output, the length of space and characters is different (the drawtext function has not been tried, but it should be the same ), therefore, the characters in the output Column cannot be aligned (for example, the column number). How can this problem be solved? First, let's look at a usage that printf and sprintf are not well-known:
Printf ("% 05d", I) is used to output a right-aligned integer. If the number of digits is not enough, add 0 to the left.
Therefore, you can use the following method to align the string:
Sprintf (TMP, "% 08d % 08d", I, j );
Cstring STR (TMP );