The following code gives me a segmentation fault when run on a 2Gb machine, but works on a 4GB machine.
int main() { int c[1000000]; cout << \"do
Because you store the array in the stack. You should store it in the heap. See this link to understand the concept of the heap and the stack.