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
Explain what is wrong with this statement? Myname = ?robin?;
What is sizeof c?
Can a pointer be static?
What are identifiers and keywords in c?
What is break in c?
What is use of integral promotions in c?
Explain modulus operator.
Which header file should you include if you are to develop a function which can accept variable number of arguments?
What is restrict keyword in c?
Do pointers need to be initialized?
Write a program to check armstrong number in c?
1.int a=10; 2.int b=20; 3. //write here 4.b=30; Write code at line 3 so that when the value of b is changed variable a should automatically change with same value as b. 5.
Do you know the use of 'auto' keyword?
why do some people write if(0 == x) instead of if(x == 0)?
What are pointers? What are different types of pointers?