你要是用到CString类的话可以。如果有:int a = 25;CString str;str.Format("%04d",a);// 其中的4表示占4行,0就是填充符这时 字符串 str = "0025"这和C里面的格式化输出类似。
类似的 printf("%04d", 12);
受教了