How can I allocate arrays or structures bigger than 64K?

Answer Posted / dinakarangct

#include<stdio.h>
struct stud {
int i,j,k;
struct stud *next,*prev;
}**ptr;
void main(){
int i;
ptr= ( struct stud **)malloc(sizeof(struct stud*)*6400 );
for(i=0;i<6400;i++)
ptr[i]= ( struct stud *)malloc(sizeof(struct stud)*10 );
}

Is This Answer Correct ?    5 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is return type in c?

646


In c programming write a program that will print 10 multiples of 3 except 15,18,21 using looping

983


How is null defined in c?

656


Why calloc is better than malloc?

574


What does s c mean on snapchat?

590






What are the disadvantages of a shell structure?

697


What is atoi and atof in c?

620


Are there namespaces in c?

571


What is the equivalent code of the following statement in WHILE LOOP format?

774


Why doesnt long int work?

617


What is a method in c?

630


What is the difference between declaring a variable by constant keyword and #define ing that variable?

2706


What is c preprocessor mean?

797


What is %d used for?

590


What is a protocol in c?

561