c++ program won't work

Associate
Joined
12 May 2005
Posts
1,777
MY program won't work, there are no compilation errors and I get a stack overflow error while debugging. Its a very simple program that finds line intersections from a huge list of co-ordinates. Any ideas as to why it fails would be very helpful.
I've find out that these variables are causing the problem, but they are vital to the advanced part of the program:
// double xvalues[1001] = {0};
// double yvalues[1001] = {0};
// double x1values[1001] = {0};
// double y1values[1001] = {0};
double gradients[1001] = {0};
double constants[1001] = {0};
// double intersects[1001][1001][1] = {0};
 
Last edited:
Visual c++ doesn't like my programs, the compiler crashes most of the time.
You dynamically allocate arrays by doing this:
myarray = new double[3][5]; But if I try this:
double myarray[2][2];
myarray = new double [2]; I get all kinds of strange errors regarding converting [*] to [*][2] and something about pointers which I have never seen the point of using.
 
Back
Top Bottom