Avatar of kuntilanak
kuntilanak
Flag for United States of America asked on

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?
CC++C#

Avatar of undefined
Last Comment
kuntilanak

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Subrat (C++ windows/Linux)

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

ASKER
is it possible to initialize the table to null at first??
Subrat (C++ windows/Linux)

yes.
a[x] = (int*)calloc(sizeof(int), 3);
kuntilanak

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

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

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

ASKER
yes that was a typo