Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Pointer question

  1. Oct 13, 2008 #1
    when i declare

    Code (Text):

    int* ptr_a, ptr_b;

    why the type of ptr_b is int
    and not int*

  2. jcsd
  3. Oct 13, 2008 #2


    User Avatar
    Science Advisor
    Homework Helper

    Code (Text):
    int *pta_a, ptr_b;
    Code (Text):
    int *pta_a; int ptr_b;
    and not
    Code (Text):
    int *pta_a; int *ptr_b;
    which would be
    Code (Text):
    int *pta_a, *pta_b;
  4. Oct 13, 2008 #3
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook