Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Converting an int to a string

Hello

Does anyone know if it is possible to convert an integer to a string, (and if so how how?).

I need it because it an using a function fstat() to return the size of a file and i need to strcat() the result (which is an int) to a string saying "Length = ".

thanks for your help and your time.

Comments

  • ajh_ptrajh_ptr Member Posts: 2
    : Hello
    :
    : Does anyone know if it is possible to convert an integer to a string, (and if so how how?).
    :
    : I need it because it an using a function fstat() to return the size of a file and i need to strcat() the result (which is an int) to a string saying "Length = ".
    :
    : thanks for your help and your time.
    :

    char str[5];
    int i=6573;
    sprintf(str,"%d",i);
Sign In or Register to comment.