title: Factor a large number efficiently with gmp
body: <p>I need to get all the prime factors of large numbers that can easily get to 1k bits.
  The numbers are practically random so it shouldn't be hard.
  How do I do it efficiently? I use C++ with GMP library.</p>
  
  <p>EDIT:
  I guess you all misunderstood me.<br>
  What I mean by prime a number is to get all prime factors of the number.<br>
  Sorry for my english, in my language prime and factor are the same :)</p>
  
  <hr>
  
  <p>clarification (from OP's other post):</p>
  
  <p>What I need is a way to efficiently factor(find prime factors of a number) large numbers(may get to 2048 bits) using C++ and GMP(Gnu Multiple Precession lib) or less preferably any other way.
  The numbers are practically random so there is little chance it will be hard to factor, and even if the number is hard to factor, I can re-roll the number(can't choose though).</p>