Thread: Newbie Programmer

  1. #1
    Registered User
    Join Date
    May 2004

    Newbie Programmer

    Ok I admit I'm a total newbie, never even opened up a programming interface before lol
    So I'm wondering why I'm making executables just fine but they don't run. I did everything right so Ii figure it might because I'm using Windows XP (Gawd I need to get Mandrake back! ).
    I have no clue why but not even the most simple project runs.
    Anyway I wondered if anyone could help this clueless newbie programmer
    Thanks a bunch

  2. #2
    Registered User
    Join Date
    Mar 2002
    It may be running but the results are removed from the screen so fast you can't see the results. What compiler are you using? Consider using any one of a number of the following lines just before the return 0 at the end of your code:

    Version 1:
    char ch;
    cin >> ch;

    Version 2:

    Version 3;

    If none of those work, post code using code tags as described in the instructions at the top of the forum.

  3. #3
    Registered User major_small's Avatar
    Join Date
    May 2003
    use version 3...

    version 1 allocates one extra byte you don't need (not too big of a deal)
    version 2 isn't very portable, although it does continue the program even if the user presses the 'j' key...
    version 3 only continues if the user presses enter

    you could also look up kbhit() if you want any key on the keyboard to restart the flow of the program, but usually cin.get() is good enough...

    another thing is you may want to check your documentation... you may just be compiling/linking/etc. without running... every compiler I've worked with has seperate options to complete seperate parts of the process...
    Last edited by major_small; 05-18-2004 at 12:27 PM. Reason: more added
    Join is in our Unofficial Cprog IRC channel
    Channel: #Tech

    Team Cprog Folding@Home: Team #43476
    Download it Here
    Detailed Stats Here
    More Detailed Stats
    52 Members so far, are YOU a member?
    Current team score: 1223226 (ranked 374 of 45152)

    The CBoard team is doing better than 99.16% of the other teams
    Top 5 Members: Xterria(518175), pianorain(118517), Bennet(64957), JaWiB(55610), alphaoide(44374)

    Last Updated on: Wed, 30 Aug, 2006 @ 2:30 PM EDT

  4. #4
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    The edge of the known universe
    How about posting an example of what you tried.
    "It didn't work" is pretty useless
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Newbie programmer with his first frustration
    By galactic_ronin in forum C++ Programming
    Replies: 14
    Last Post: 02-20-2008, 02:39 PM
  2. Newbie c programmer need assistance plz...
    By Nexus-ZERO in forum C Programming
    Replies: 17
    Last Post: 12-27-2007, 04:05 PM
  3. Newbie programmer, few quick questions...
    By cjmdjm in forum C++ Programming
    Replies: 1
    Last Post: 10-29-2005, 10:51 PM
  4. Yet another newbie programmer
    By Ken Rogers in forum C++ Programming
    Replies: 7
    Last Post: 10-12-2005, 01:59 PM
  5. newbie programmer - needs help bad.
    By hortonheat in forum C Programming
    Replies: 17
    Last Post: 10-20-2004, 05:31 PM