Is %p specifier only for valid pointers?

Viewed 1050

Suppose on my platform sizeof(int)==sizeof(void*) and I have this code:

printf( "%p", rand() );

Will this be undefined behavior because of passing a value that is not a valid pointer in place of %p?

4 Answers
Related