1. Not finding help here? Sign up for a free 30min tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Aghhh vectors

  1. Oct 8, 2006 #1
    Ok, I'm trying this code in Dev-C++

    int main(int argc, char **argv)
    double **a;
    double *b;
    // double *m;
    int n, iter;
    double tol;

    b = new double[n];

    a = new double*[n];
    for (int i = 0; i < n + 1; i++)
    a = new double[n];

    // m = new double[n];

    cout << "I'm ready to continue =)!!!";

    return 0;

    If I omit the m vector, the program will run and not disappear in a second and it will be ready to continue.. but when I declare the m vector without even doing anything with it... it just runs and quits quicker than I can blink my eye...! Why is this happening =(?
  2. jcsd
  3. Oct 8, 2006 #2
    Forget this post, I just realized I had to initialize n before doing any of this ... tehe =)
  4. Oct 8, 2006 #3
    n is undefined.

    Edit: Sorry, just saw your follow up.
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?

Similar Discussions: Aghhh vectors
  1. C++ Vectors (Replies: 1)