hi ,
i need to create an array of long integers containing 17000 elements.how do i do it? can anyone help?
thanks,pearl
hi ,
i need to create an array of long integers containing 17000 elements.how do i do it? can anyone help?
thanks,pearl
Last edited by Pearl; 08-13-2004 at 01:54 AM.
long int array[17000];
If that's what you tried and it didn't work, then try mentioning which OS/Compiler or whatever other useful information you may have.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
Did you try it and get an error from your compiler? What did the error say?
If you try to allocate arrays of very large size within a function you will often get errors because each function has a limited stack size. You can either try to allocate the array as a global, or you can have a pointer variable within your function and attempt to allocate memory for that array dynamically with a malloc call.
"Owners of dogs will have noticed that, if you provide them with food and water and shelter and affection, they will think you are god. Whereas owners of cats are compelled to realize that, if you provide them with food and water and shelter and affection, they draw the conclusion that they are gods."
-Christopher Hitchens