473,386 Members | 1,699 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

pointers to 3dimensional array?

1
can anyone please explain me the concept of pointers in multidimensional array?
Expand|Select|Wrap|Line Numbers
  1. #include<stdio.h>
  2. #include<conio.h>
  3. int main()
  4. {
  5. int a[2][3][2]={
  6.                       {
  7.                       {11,4},
  8.                       {7,8},
  9.                       {3,4},
  10.                       },
  11.                  {
  12.                       {2,2},
  13.                       {2,3},
  14.                       {31,23},
  15.                       }
  16.                       };
  17. printf("%u\n",a);
  18. printf("%u\n",*a);
  19. printf("%u\n",**a);
  20. printf("%u\n",***a);
  21. printf("%u\n",a+1);
  22. printf("%u\n",*a+2);
  23. printf("%u\n",**a+2);
  24. printf("%d\n",***a+1);
  25. printf("%d\n",a[1][2][0]);
  26. printf("%u\n",*(a+1));
  27. printf("%u\n",*(*(a+0)+2));
  28. printf("%d\n",*(*(*(a+1)+2)+0));
  29. getch();
  30. return 0;
  31. }
Jun 12 '14 #1
1 1062
weaknessforcats
9,208 Expert Mod 8TB
Read this: http://bytes.com/topic/c/insights/77...rrays-revealed

Post again if you still have questions.
Jun 12 '14 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

11
by: Anthony Moss | last post by:
How do you use a double pointer to access a two dimensional array. ie int a; int **p; - - - - -
4
by: Il Prof | last post by:
Hi to everyone! ;) In C language on Linux, what string access method is faster? 1) Puntatori char str="hello"; char* pstr; pstr = str; // access such as "*pstr"
2
by: Shalini | last post by:
when coding with command line arguments, is *argv similar to **argv ?? -- Shalini ------------------------------------------------------------------------ Posted via...
3
by: ozbear | last post by:
This is probably an obvious question. I know that pointer comparisons are only defined if the two pointers point somewhere "into" the storage allocated to the same object, or if they are NULL,...
204
by: Alexei A. Frounze | last post by:
Hi all, I have a question regarding the gcc behavior (gcc version 3.3.4). On the following test program it emits a warning: #include <stdio.h> int aInt2 = {0,1,2,4,9,16}; int aInt3 =...
2
by: Simon Morgan | last post by:
I hope this isn't OT, I looked for a newsgroup dealing purely with algorithms but none were to be found and seeing as I'm trying to implement this in C I thought this would be the best place. I...
8
by: Piotrek | last post by:
Hi, Like almost all of beginners I have problem understanding pointers. Please, look at this piece of code, and please explain me why myswap function doesn't work as it's supposed to do, whereas...
25
by: J Caesar | last post by:
In C you can compare two pointers, p<q, as long as they come from the same array or the same malloc()ated block. Otherwise you can't. What I'd like to do is write a function int comparable(void...
3
by: JoxC | last post by:
Hey guys, I was wondering if there is an *efficient* way in setting every pointer in an array of pointers to NULL? memset cannot work for compatibility reasons, but I was playing a bit with...
4
by: rm84 | last post by:
# include <iostream> using namespace std; int main (void) { int arr,*arrf; arrf=arr+5; cout<<arr<<endl<<arrf<<endl; for(;arr<=arrf;arr=arr+1) {
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.