Like Tree2Likes
  • 2 Post By camel-man

Help needed in creating a program

This is a discussion on Help needed in creating a program within the C Programming forums, part of the General Programming Boards category; Okay so i have an assignment to do that requires me to create a lottery generator. The program has to ...

  1. #1
    Registered User
    Join Date
    Nov 2012
    Posts
    1

    Unhappy Help needed in creating a program

    Okay so i have an assignment to do that requires me to create a lottery generator. The program has to ask the user to enter a maximum number in the lottery then put in how many numbers they want to generate from the program 1 - 6 different numbers...These numbers have to be randomized and are not allowed to be repeated...so for example its not allowed to generate a group of numbers such as 4 4 5 3...no 2 or more of the same numbers...and also some validations like if they enter a number that is too low or too high then what the program is asking then the program should ask again for the input and tell the user why its asking again...I have been at this for a week now and i keep getting segmentation fault after compiling it and i need help with this if it would be possible. Thank you.

  2. #2
    Registered User camel-man's Avatar
    Join Date
    Jan 2011
    Location
    Under the moon
    Posts
    593
    It would help if you posted your code.
    dennis.cpp and Raj 89 like this.

  3. #3
    TEIAM - problem solved
    Join Date
    Apr 2012
    Location
    Melbourne Australia
    Posts
    1,323
    A seg-fault means that you have tried to access memory which your program does not have permission to use.

    Check that you are not going out of bounds with an array and all your pointers have been initialised before using them.
    Fact - Beethoven wrote his first symphony in C

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Help Needed for Program.
    By B182 in forum C Programming
    Replies: 1
    Last Post: 11-25-2011, 11:09 AM
  2. Help needed in creating a game using c
    By caprigirl in forum C Programming
    Replies: 1
    Last Post: 10-10-2010, 12:55 AM
  3. Help needed in creating a game using c
    By caprigirl in forum C Programming
    Replies: 1
    Last Post: 10-10-2010, 12:53 AM
  4. Help is needed on creating a pointer stack
    By yuzhangoscar in forum C Programming
    Replies: 3
    Last Post: 09-15-2008, 07:57 PM
  5. Help needed in creating a process
    By sac_garg in forum C Programming
    Replies: 3
    Last Post: 10-01-2006, 01:40 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21