Results 1 to 3 of 3

Thread: Pointer to a 2D array of pointers ??

  1. #1
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Pointer to a 2D array of pointers ??

    How do I declare a pointer, which points to a 2 dimensional array of pointers ??

    Say I have CAbc *pAbc[10][10];

    how do I declare a pointer to pAbc ?

  2. #2
    Join Date
    Jan 2006
    Location
    Kerala
    Posts
    371
    Thanks
    76
    Thanked 37 Times in 32 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Pointer to a 2D array of pointers ??

    This would help, I hope
    Qt Code:
    1. int i;
    2. int *p = &i;
    3.  
    4. int oneDimArray[10];
    5. int *pointerToOneDimArray= oneDimArray;
    6.  
    7. int *oneDimArrayOfPointers[10];
    8. int **pointerToOneDimArrayOfPointers = oneDimArrayOfPointers;
    9.  
    10. int twoDimArray[10][10];
    11. int (*pointerToTwoDimArray)[10] = twoDimArray;
    12.  
    13. int *twoDimArrayOfPointers[10][10];
    14. int *(*pointerToTwoDimArrayOfPointers)[10] = twoDimArrayOfPointers;
    To copy to clipboard, switch view to plain text mode 
    We can't solve problems by using the same kind of thinking we used when we created them

  3. #3
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Pointer to a 2D array of pointers ??

    Thanks

    I guess it will help

Similar Threads

  1. array of pointers to functions
    By moowy in forum General Programming
    Replies: 3
    Last Post: 19th October 2006, 10:48
  2. simple pointer question
    By mickey in forum General Programming
    Replies: 6
    Last Post: 16th June 2006, 09:19
  3. How to create QPixmap from unsigned character array?
    By rashidbutt in forum Qt Programming
    Replies: 4
    Last Post: 16th May 2006, 18:25
  4. array + template ?
    By mhoover in forum General Programming
    Replies: 3
    Last Post: 10th February 2006, 19:23
  5. Problem with pointers while using localtime() and time()
    By jamadagni in forum General Programming
    Replies: 7
    Last Post: 11th January 2006, 15:48

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.