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

    CompuChip

    User Avatar
    Science Advisor
    Homework Helper

    Because
    Code (Text):
    int *pta_a, ptr_b;
    means
    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
    thanks
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?



Similar Discussions: Pointer question
  1. A pointer value question (Replies: 13)

Loading...