• +91 9723535972
  • info@interviewmaterial.com

C Interview Questions and Answers

Question - How do you print an address?

Answer - The safest way is to use printf() (or fprintf() or sprintf()) with the %P specification. That prints a void pointer (void*). Different compilers might print a pointer with different formats. Your compiler will pick a format that’s right for your environment. If you have some other kind of pointer (not a void*) and you want to be very safe, cast the pointer to a void*: printf( %Pn, (void*) buffer );

Comment(S)

Show all Coment

Leave a Comment




NCERT Solutions

 

Share your email for latest updates

Name:
Email:

Our partners