Linked Questions
45 questions linked to/from Is there a max array length limit in C++?
-6
votes
3
answers
17k
views
What is the maximum size of 2 dimensional array that we can use in c++ programming? [duplicate]
I tried using 10^6 by 10^6 array ,it is giving me segmentation fault
-3
votes
1
answer
15k
views
What is the maximum number of elements that can be stored in array in C++? [duplicate]
We can store elements only up to a [10000000] (10^7) in a array of integers.Is there a way to store even more number of data's.And also what is the maximum size of character array.Please forgive if ...
1
vote
1
answer
285
views
C++ C-style array size limit [duplicate]
I am trying to create a 2 dimensional int array of size 800.
This is my code:
#include <iostream>
int main()
{
int array[800][800];
std::cout << 1;
}
My problem is that it never ...
0
votes
5
answers
227
views
Is there a maximum number of rows allowed for this array? C++ [duplicate]
(edited to correct a mistake and specify code is written for C++)
I am making a large array, P_arr of size
int N = 30;
float P_arr[27000][4];
with elements given by
float ua_min = 0.0001, ...
0
votes
0
answers
77
views
Largest allocatable array in VC++ 2010 [duplicate]
Does anyone what the largest array is that I can allocate in Visual C++ 2010? The maximum number of elements, I mean. Can I do something like int tarray [unsigned long], where unsigned long is some ...
651
votes
29
answers
1.3m
views
How do I declare a 2d array in C++ using new?
How do i declare a 2d array using new?
Like, for a "normal" array I would:
int* ary = new int[Size]
but
int** ary = new int[sizeY][sizeX]
a) doesn't work/compile and b) doesn't accomplish what:
...
79
votes
9
answers
51k
views
Difference between array type and array allocated with malloc
Today I was helping a friend of mine with some C code, and I've found some strange behavior that I couldn't explain him why it was happening. We had TSV file with a list of integers, with an int each ...
54
votes
7
answers
22k
views
Getting a stack overflow exception when declaring a large array
The following code is generating a stack overflow error for me
int main(int argc, char* argv[])
{
int sieve[2000000];
return 0;
}
How do I get around this? I am using Turbo C++ but would like ...
4
votes
8
answers
7k
views
C++ Array vs vector
when using C++ vector, time spent is 718 milliseconds,
while when I use Array, time is almost 0 milliseconds.
Why so much performance difference?
int _tmain(int argc, _TCHAR* argv[])
{
const int ...
11
votes
8
answers
2k
views
When can a memory leak occur?
I don't know what to think here...
We have a component that runs as a service. It runs perfectly well on my local machine, but on some other machine (on both machine RAM's are equal to 2GB) it starts ...
8
votes
4
answers
5k
views
Programmatically find maximum static array size in C++
I am curious whether it is possible to determine the maximum size that an array can have in C++.
#include <iostream>
using namespace std;
#define MAX 2000000
int main()
{
...
SirGuy's user avatar
- 10.8k
6
votes
4
answers
16k
views
Maximum amount of data that can be sent using MPI::Send
With the syntax for MPI::Isend as
MPI::Request MPI::Comm::Isend(const void *buf, int count,
const MPI::Datatype& datatype,
int dest, int tag) const;
is the amount of ...
2
votes
6
answers
3k
views
Very large array on the heap (Visual C++)
I hope some one can help me, i'm trying to create an int[400000000] (400 millions) array on my application using visual c++ 2010 but it generates an overflow error
The same code runs on linux with g++....
4
votes
6
answers
4k
views
Array crashes with more than 120000 elements [duplicate]
When i do:
vector<double> myVect(120000000, 0);
I can make the vector hold seemingly as many elements as i want. However, when i do:
double myArray[120000];
I am limited to somewhere around ...
4
votes
3
answers
11k
views
c++ dynamic memory allocation limit
Is there any kind of limit, system or otherwise, for dynamic allocation with new or malloc in C++?
The system is 64bit and I want to allocate an array of some ~800million structs.
Edit: The reason I ...