Hi, I'm not understanding where I went wrong here. It compiles fine, but then my file doesn't have the array numbers and gives a stack overflow warning. Can anyone tell me where I went wrong?
#include <iostream>
#include <fstream>
using namespace std;
const int NUM_ARRAY = 20;
void file(double[]);
void secondFile(double[]);
> and gives a stack overflow warning
¿? stack overflow is a fatal error.
I did not observe such behaviour, and don't see anything in the code that may cause it.
However
$ g++ -W{all,extra,pedantic} foo.cpp
foo.cpp: In function ‘void file(double*)’:
foo.cpp:36:9: warning: statement has no effect [-Wunused-value]
for (x; x < NUM_ARRAY; x++);
¿see the semicolon at the end? that was your loop executes
(you would have no issue if you had limited the scope of the variable)