Jump to content

pointer to two dimensional array

- - - - -

  • Please log in to reply
4 replies to this topic

#1
Amonijack

Amonijack

    Learning Programmer

  • Members
  • PipPipPip
  • 56 posts
Does someone can explain me what means this :

*(p+(i*3)+j)

?
thank you in advance

#2
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
  • Location:Upstate, South Carolina
  • Programming Language:C, C++, PL/SQL, Delphi/Object Pascal, Pascal, Transact-SQL, Others
  • Learning:Java, C#, PHP, JavaScript, Lisp, Fortran, Haskell, Others
What are the types of p, i, and j?
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

#3
Flying Dutchman

Flying Dutchman

    Programming God

  • Members
  • PipPipPipPipPipPipPip
  • 889 posts
  • Location:::1
I'd assume i and j are loop counters and p is a two dimensional array or pointer to a pointer (which is pretty much the same). If that's the case, your code should be equivalent to

p[i][j];

Also, judging by that 3 near i, I'd assume the p array is something like this:

Type p[3][second_size];


A conclusion is where you got tired of thinking.
#define class struct    // All is public.

#4
shiyamhoda

shiyamhoda

    Newbie

  • Members
  • PipPip
  • 17 posts

Flying Dutchman said:

I'd assume i and j are loop counters and p is a two dimensional array or pointer to a pointer (which is pretty much the same). If that's the case, your code should be equivalent to

p[i][j];

Also, judging by that 3 near i, I'd assume the p array is something like this:

Type p[3][second_size];

Agreed

#5
Amonijack

Amonijack

    Learning Programmer

  • Members
  • PipPipPip
  • 56 posts
i get it but i forgot to write here ... thank you guys :)




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users