Thread: Newbie here. Please help.

  1. #1
    Registered User
    Join Date
    Aug 2014
    Posts
    47

    Newbie here. Please help.

    Hi guys. Im kinda new in programming. I want to create a word game using c. My question is it possible to set questions and the system will randomly display each? If yes, what's the right code? Thanks in advance.

  2. #2
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    Yes. As for the right code: start with a simpler program. For example, write a program that will shuffle the integers from 0 to 10 and print them.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  3. #3
    Registered User
    Join Date
    Aug 2014
    Posts
    47
    What's the right syntax for that sir? im a real newbie so im kinda unfamiliar with the syntax and its functions

  4. #4
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    The thing is, it isn't just about syntax. It is a matter of problem solving. You need to think of the logic to come up with an algorithm.

    Are you able to write a "hello world" program with referring to your textbook/notes/tutorials? Do you know how to define an array and access it?
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  5. #5
    Registered User
    Join Date
    Aug 2014
    Posts
    47
    Im just about to begin to study about arrays. Can you give the right code to randomly select a question and then display it?

  6. #6
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    Yes, but it is better for you to make an attempt first.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  7. #7
    Registered User rogster001's Avatar
    Join Date
    Aug 2006
    Location
    Liverpool UK
    Posts
    1,472
    Try making a program that can first output a random number. The question selection can come later.
    Thought for the day:
    "Are you sure your sanity chip is fully screwed in sir?" (Kryten)
    FLTK: "The most fun you can have with your clothes on."

    Stroustrup:
    "If I had thought of it and had some marketing sense every computer and just about any gadget would have had a little 'C++ Inside' sticker on it'"

  8. #8
    Registered User
    Join Date
    Aug 2014
    Posts
    47
    I have a little problem sir. Everytime i compile, a small window will display "g++.exe has stopped working"..

  9. #9
    Registered User rogster001's Avatar
    Join Date
    Aug 2006
    Location
    Liverpool UK
    Posts
    1,472
    problem with the environment - searching google led me to this link for example.
    Just google the error and see what matches your setup if that link is not right for you.
    Thought for the day:
    "Are you sure your sanity chip is fully screwed in sir?" (Kryten)
    FLTK: "The most fun you can have with your clothes on."

    Stroustrup:
    "If I had thought of it and had some marketing sense every computer and just about any gadget would have had a little 'C++ Inside' sticker on it'"

  10. #10
    Registered User
    Join Date
    Aug 2014
    Posts
    47
    Is C language v4.9.9.2 compatible with windows 8? My notebook ran out of battery. We dont have supply of electricity sice the last typhoon because it has destroyed the main lines. I have to wait for tomorrow to fix this.

  11. #11
    Registered User zub's Avatar
    Join Date
    May 2014
    Location
    Russia
    Posts
    104
    I am very big fan of TCC. Highly recommended!

    I advise you to take a notebook (paper thing, not a computer) and try to think about the algorithm. Translation into the programming language is not difficult. It is difficult to write a program without clear algorithm.
    Our goals are clear, tasks are defined! Let's work, comrades! -- Nikita Khrushchev

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Hello, I am a newbie and so I have a newbie question;)
    By piratemonkey247 in forum C Programming
    Replies: 4
    Last Post: 12-20-2012, 10:59 AM
  2. Newbie with Very Newbie Question
    By Jedi_Mediator in forum C++ Programming
    Replies: 18
    Last Post: 07-01-2008, 08:00 AM
  3. some more newbie help please
    By MystWind in forum C++ Programming
    Replies: 3
    Last Post: 02-25-2005, 01:25 PM
  4. newbie help please
    By MystWind in forum C++ Programming
    Replies: 7
    Last Post: 02-25-2005, 11:45 AM
  5. C++ newbie / linux not so newbie question
    By goldmonkey in forum C++ Programming
    Replies: 7
    Last Post: 12-13-2003, 12:27 PM