Thread: Various errors with pointers

  1. #16
    Registered User
    Join Date
    Nov 2008
    Location
    Sweden
    Posts
    5
    If I understand this right you want to get a digit between 0-8.. You can do this easy by using the modulo operation.. Just do rando = rand() % 9; This will always get u a digit below 9.

  2. #17
    Registered User
    Join Date
    Nov 2008
    Posts
    16
    I did meant /1000000000 but now that you're telling it, I'm not sure it's the best option.

    I changed it for modulo 10 and it's quite well working. Wow, really thank you all! But now still I got another problem, I need 6 pairs of same digits...I'll try to work that out and come up with something. Still, I got no idea how this can be done.

    Thanks for all your comments!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 4
    Last Post: 12-10-2006, 07:08 PM
  2. Errors with header files in OpenGL using VisualC++
    By wile_spice in forum Game Programming
    Replies: 3
    Last Post: 06-22-2006, 08:56 AM
  3. Passing pointers between functions
    By heygirls_uk in forum C Programming
    Replies: 5
    Last Post: 01-09-2004, 06:58 PM
  4. Request for comments
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 15
    Last Post: 01-02-2004, 10:33 AM
  5. Pointers, Classes, and Errors o my!
    By Scottc1988 in forum C++ Programming
    Replies: 12
    Last Post: 03-13-2003, 10:14 PM