Adding an int to a string

Started by
13 comments, last by Chryzmo 19 years, 10 months ago
He won't hit any size restrictions with a 1024 buffer and that string. ints cant hold numbers big enough to fill up 1024 spaces.

[edited by - DukeAtreides076 on May 26, 2004 7:58:27 PM]
Advertisement
quote:Original post by DukeAtreides076
He won't hit any size restrictions with a 1024 buffer and that string. ints cant hold numbers big enough to fill up 1024 spaces.

But it's possible the destination string could contain more than just integers. snprintf is the safer, still-C alternative. And why not be safe when you can be?

[edited by - Zipster on May 26, 2004 8:21:21 PM]
If I wanted to be safe, I''d use the STL in the first place.

I live on the edge baby! ^_^
Push it to the limit.
your not save with sprintf, you could print i.e. 200 64bit-integers, using full size, into a string, which has a size of 1024...

This topic is closed to new replies.

Advertisement