Using printf() is unsafe because you have no way of limiting just how far printf() will read. Maybe it will stop immediately, maybe it will stop because it tried to access memory it didn't own and the OS crashed it.
er... I guess technically that's safe but it won't print "5" like you expect. It will print the ascii code for 5 (which is ?ENQUIRY? It probably has no visual representation).