Thread: Static vs. Dynamic Arrays, Getting Undefined Behavior

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #11
    The larch
    Join Date
    May 2006
    Posts
    3,573
    But if you insist on finding the divisors, you can add them to a std::vector, which is a dynamically growing array. The reason is that you don't know how many divisors there's going to be (you'd know that after finding how many prime factors there are ), could be 10, could be 1000, could be a million.
    Last edited by anon; 01-18-2012 at 04:23 AM.
    I might be wrong.

    Thank you, anon. You sure know how to recognize different types of trees from quite a long way away.
    Quoted more than 1000 times (I hope).

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Is x=x++; Undefined Behavior?
    By envec83 in forum C Programming
    Replies: 5
    Last Post: 10-04-2011, 01:27 AM
  2. Undefined behavior from VC6 to 2k5
    By m37h0d in forum C++ Programming
    Replies: 10
    Last Post: 06-22-2011, 07:56 PM
  3. openGL: textures, gluLookAt, and undefined behavior
    By MK27 in forum Game Programming
    Replies: 7
    Last Post: 04-28-2009, 10:12 AM
  4. Dynamic libs and undefined references
    By ccox421 in forum C Programming
    Replies: 5
    Last Post: 03-28-2009, 10:25 AM
  5. Static array is allocated in undefined area
    By esben in forum C Programming
    Replies: 4
    Last Post: 05-13-2006, 05:24 PM

Tags for this Thread