About
Pricing
Community
Teams
Start Free Trial
Log in
kuntilanak
asked on
2/24/2009
dynamic 2d array of pointers
Say I have a struct called PCB, how can I declare a 2d array of pointers to PCB inside the heap? How do I access it?
C
C++
C#
7
3
Last Comment
kuntilanak
8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Subrat (C++ windows/Linux)
2/24/2009
THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
kuntilanak
2/24/2009
ASKER
is it possible to initialize the table to null at first??
Subrat (C++ windows/Linux)
2/24/2009
yes.
a[x] = (int*)calloc(sizeof(int), 3);
kuntilanak
2/24/2009
ASKER
so if it's an array of pointer to a pcb, where pcb is a struct will it be something like:
int ***a = (int**)malloc(sizeof(pcb *) * 10);
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy
SOLUTION
Infinity08
2/25/2009
THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
SOLUTION
itsmeandnobodyelse
2/25/2009
THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
kuntilanak
2/25/2009
ASKER
yes that was a typo