try it, then you know it____________just do it , as love easily fade.

一次只有一个目标,步子迈小些,抑制一次实现所有功能的冲动。 过程如何结果就如何,行动是欢喜的,不管是兴奋还是沮丧的情绪都对结果无益。贵在持之以恒

导航

库函数, string , integer to char


#include <stdio.h> //use of itoa: integer to char //puts output char* //convert string to char* //string name with accumulated acount. string sName = "book-"; int iCount; char cBuffer[3]; itoa(iCount, cBuffer, 10); if(iCount < 10) sName += "00"; if(iCount < 100) sName += "0"; if(iCount >= 1000) std::cerr << "no valid name index" << std::endl; sName += cBuffer; puts(sName .c_str() );

 

posted on 2013-03-19 20:24  吾一  阅读(185)  评论(0编辑  收藏  举报