what's mean by "%u" & "%p"? where to use it?

Recommended Answers

All 2 Replies

You can use %p to print the address of a variable, but it takes only (void *) as arguments. So a type cast is needed. Check this :

printf("%p", (void *)&var);

whereas %u is used to print an unsigned integer in decimal value.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.