How can I allocate arrays or structures bigger than 64K?
Answers were Sorted based on User's Feedback
Answer / s.v.prasad reddy,lifetree
Generally using the malloc() function maximum we can
allocate the 64K memory.
If you want to allocate the memory larger than 64K then you
have to use the farmalloc() memory management function.
And one more important thing is ,Once memory is allocated
by the farmalloc(),then to free that memory we need to use
only farfree() fuction.We can't use the free() fuction to
free that memory.
| Is This Answer Correct ? | 15 Yes | 2 No |
Answer / sathish kumar
HI All,
In a book i studied that you can use far* to allocate
memory above 64k limit.
Thanks & Regards
Sathish Kumar
| Is This Answer Correct ? | 6 Yes | 4 No |
Answer / phani kumar s
by using the pointers with the structures we can allocate the
memory for the structure ,Pointers are DMA
| Is This Answer Correct ? | 3 Yes | 2 No |
Answer / 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 |
Answer / nithya
For arrays larger than 64k use
char huge array3[100000L];
| Is This Answer Correct ? | 0 Yes | 3 No |
how much salary u want ? why u join in our company? your domain is core sector why u prefer software ?
main() { int a=4,b=2; a=b<<a + b>>2; printf("%d", a); }
What are the different types of data structures in c?
What are the advantages and disadvantages of pointers?
find second largest element in array w/o using sorting techniques? use onle one for loop.
15 Answers BitWise, Zycus Infotech,
what is the difference between arrays and linked list
26 Answers MAHINDRA, Tech Mahindra, Wipro,
How to throw some light on the b tree?
There is a 100-story building and you are given two eggs. The eggs (and the building) have an interesting property that if you throw the egg from a floor number less than X, it will not break. And it will always brake if the floor number is equal or greater than X. Assuming that you can reuse the eggs which didn't broke; you got to find X in a minimal number of throws. Give an algorithm to find X in minimal number of throws.
#define f(g,h) g##h main O int i=0 int var=100 ; print f ("%d"f(var,10));} what would be the output?
What is the use of a conditional inclusion statement in C?
what is the use of pointers
How do you determine whether to use a stream function or a low-level function?