The reason it doesn't work is because a string is an array of characters, which as far as the compiler is concerned is identified by the address of the first element. If you pass in, say, 5 to a function which is expecting a string, then it will use 5 as the address of the string. So you are derefererencing an invalid pointer. Also, the number 5 is not the same as the character '5'. The itoa() function (short for int to ascii) converts a number to a string representation of that number, in a base (also called a radix) that you specify. Usually you will want it in decimal, so the radix is 10.