Hello,
I wonder how to resize such array of structures using realloc()?
#include <stdio.h>
#include <stdlib.h>
#define FIRST 7
typedef struct {
char *name;
int i;
int j;
} STRUCTURE;
STRUCTURE **p_structure;
int main() {
p_structure = (STRUCTURE **) malloc(FIRST * sizeof(STRUCTUR E));
if ( p_structure == NULL ) {
printf("Failed to allocate memory, exiting...");
return 1;
}
}
Thank you in advance
Svata
I wonder how to resize such array of structures using realloc()?
#include <stdio.h>
#include <stdlib.h>
#define FIRST 7
typedef struct {
char *name;
int i;
int j;
} STRUCTURE;
STRUCTURE **p_structure;
int main() {
p_structure = (STRUCTURE **) malloc(FIRST * sizeof(STRUCTUR E));
if ( p_structure == NULL ) {
printf("Failed to allocate memory, exiting...");
return 1;
}
}
Thank you in advance
Svata
Comment