can anyone please explain me the concept of pointers in multidimensional array? - #include<stdio.h>
-
#include<conio.h>
-
int main()
-
{
-
int a[2][3][2]={
-
{
-
{11,4},
-
{7,8},
-
{3,4},
-
},
-
{
-
{2,2},
-
{2,3},
-
{31,23},
-
}
-
};
-
printf("%u\n",a);
-
printf("%u\n",*a);
-
printf("%u\n",**a);
-
printf("%u\n",***a);
-
printf("%u\n",a+1);
-
printf("%u\n",*a+2);
-
printf("%u\n",**a+2);
-
printf("%d\n",***a+1);
-
printf("%d\n",a[1][2][0]);
-
printf("%u\n",*(a+1));
-
printf("%u\n",*(*(a+0)+2));
-
printf("%d\n",*(*(*(a+1)+2)+0));
-
getch();
-
return 0;
-
}
1 1062 Sign in to post your reply or Sign up for a free account.
Similar topics
by: Anthony Moss |
last post by:
How do you use a double pointer to access a two dimensional array.
ie int a;
int **p;
-
-
-
-
-
|
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"
|
by: Shalini |
last post by:
when coding with command line arguments, is *argv similar to **argv ??
--
Shalini
------------------------------------------------------------------------
Posted via...
|
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,...
|
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 =...
|
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...
|
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...
|
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...
|
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...
|
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)
{
|
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,...
|
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...
|
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...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
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...
|
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,...
|
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...
|
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,...
| |