how to create dynaimc size of NULL pointers array ?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP


how to create dynaimc size of NULL pointers array ?



i want to have dynamic size of array of pointers , how can i do it with malloc?
without malloc it look's like this :


typedef struct Nodes
{
UINT_64 Datasequence;
UINT_32 Data;
struct Nodes* next;
}Node;
Node * head_ri_interface[2][50] ;



wich wil give mi array of [2][50] of null pointers to uninitalized struct's .
i have triied to this this like this :


void NULLPointerArrayInit(int MAX_LIST_HEAD){
int i = 0 ;

for(i = 0; i < 2; i++)
{
head_ri_interface[i] = (Node *) malloc ( sizeof(Node *) * MAX_LIST_HEAD );

}

}



but i see that i get that the struct i am pointing at are not NULL . what am i doing wrong ?





But head_ri_interface[i] is an array of 50 pointers to your structure? Are you sure you want an array of arrays?
– Some programmer dude
1 min ago


head_ri_interface[i]









By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

Visual Studio Code: How to configure includePath for better IntelliSense results

Spring cloud config client Could not locate PropertySource

Regex - How to capture all iterations of a repeating pattern?