Board index » delphi » itoa

itoa

Regarding conversion from int to char* using itoa, can you specify NULL for
the string parameter and just use the returned value?
 

Re:itoa


No, it doesn't work that way.

The function documentation specifies that the char* argument must be the
address of an array of characters long enough to hold the converted number
plus terminating '\0' character.

The returned value of itoa is a pointer to the string argument so there is
no value to calling it with NULL for the char* argument.

.  Ed

Quote
> Regarding conversion from int to char* using itoa,
> can you specify NULL for the string parameter and
> just use the returned value?

Other Threads