inti;FILE*file;...typedefboost::array<char,50>buf_t;// You can use std::array if your compiler supports itbuf_tbuffer=boost::lexical_cast<buf_t>(i);// No dynamic memory allocationputs(buffer.begin(),file);