I use turbo C which allocates 2 bytes for integers and 4
bytes for long. I tried to declare array of size 500000 of
long type using the following code...
long *arr;
arr=(long *)(malloc)(500000 * sizeof(long));
It gives a warning that "Conversion may lose significant
digits in function main"...
And the resulting array size was very less around 8400 as
compared to 500000. Any suggestions will be welcomed....
Answer Posted / vignesh1988i
good morning to you.....
here what i suggest is that , at the time of dynamic memory allocation the memory would not been in the position to allocate that much of huge memory at a single instance...... UR MEMORY WILL BE INCAPABLE IF U TRY TO ALLOCATE A HUGE AMOUNT LIKE ABOVE FOR UR USE.......
u try this.... you declare an array size of 200 or 300... this will give a warning that MEMORY FULL........ the one of the disadvantages in C is that we cant balance a very large amount of data's which are outside the range .... so only we will go for DATA BASE.......
hope this helps u for getting some ideas.......
thank u
Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Is main is user defined function?
What are formal parameters?
while loop contains parts a) initialisation, evalution of an expression,increment /decrement b) initialisation, increment/decrement c) condition evalution d) none of the above
What is volatile, register definition in C
What is variable initialization and why is it important?
How do I use strcmp?
Explain c preprocessor?
What are control structures? What are the different types?
List at least 10 sorting methods indicating their average case complexity, worst case complexity and best case complexity.
Is there any possibility to create customized header file with c programming language?
Explain the difference between getch() and getche() in c?
int i=3; this declaration tells the C compiler to a) reserve space in memory to hold the integer value b) associate the name i with this memory location c) store the value 3 at this location d) all the above
Explain what is output redirection?
Can you pass an entire structure to functions?
When should structures be passed by values or by references?