Re: display integers in a clist



parthasarathi s a wrote:

You could use the C string libraries' sprintf() function to print the
"number" into a string.-partha

"Thomas Keaney" <se40319 cs may ie> wrote:
Would anyone know of how to convert an integer to a
character(convert 1 to '1') as I want to display this in a clist.
Also, I want to concatenate this to a word(for example MEMORY 1
),where the word is MEMORY and the integer I want to display is 1 in
the clist. Thanks in advance.  

A note in case you want to avoid programming bugs and safety hazards,
commonly around by the term "buffer overflows", for your application:

*NEVER* use sprintf ()! Always use snprintf () instead!

Failing to do so is the no. 1 reason for buffer overflows and related,
easily avoidable software failures. They are not an issue of novice
programmers only.

See
http://mail.gnome.org/archives/gtk-app-devel-list/2003-October/msg00344.html
for further information on that.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]