Quote:Original post by swiftcoder
Check the man page for printf to find the format specifier for short - I don't recall it offhand.
That probably has something to do with the fact that there isn't one. At least not in standard C. Your compiler may support non-standard format specifier extensions.
Quote: A better solution would be to make s an int anyway, or even better a size_t (which is the type expected by malloc/realloc in most implementations) and use the format specifier for size_t (again, check the man page).
Again, no such thing. For scanf() integer format specifiers you've got pointer to int and pointer to unsigned int.