How do you declare a pointer to an integer in C?

  • int ptr;
  • int* ptr;
  • int_pointer ptr;
  • pointer(int) p;
To declare a pointer to an integer in C, you use the format int* ptr;. This declares a pointer variable named ptr that can store the address of an integer.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *