printf("address of literal: %p \n", "abc"); char alpha[] = "abcdef"; printf("address of alpha: %p \n", alpha); Above, literal is stored in static memory, alpha is stored in dynamic memory. I read in a book that some compilers show these two addresses using different number of bits (I only tried using gcc on Linux, and it does show different number of bits). Does it depend on the compiler, or the operating system and hardware?
%pis defined forvoid-pointers only. So strictly seen to code invokes UB.printf()is.