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 why can’t constant values be used to define an array’s initial size?
‘SAVEPOINT’ and ‘ROLLBACK’ is used in oracle database to secure the data comment. Give suitable examples of each with sql command.
What is the function of multilevel pointer in c?
What is difference between static and global variable in c?
What is the value of uninitialized variable in c?
Explain enumerated types in c language?
What is New modifiers?
how to introdu5ce my self in serco
Is javascript written in c?
find out largest elemant of diagonalmatrix
What is volatile keyword in c?
GIVEN A FLOATING POINT NUMBER HOW IS IT ACTUALLY STORED IN MEMORY ? CAN ANYONE EXPLAIN?? THE 32 BIT REPRESENTATION OF A FLOATING POINT NUMBER ALLOTS: 1 BIT-SIGN 8 BITS-EXPONENT 23 BITS-MANTISSA
FILE PROGRAMMING
When can you use a pointer with a function?
Can we declare a function inside a function in c?