Thread: For Loop Disaster

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #2
    Resu Deretsiger Nightowl's Avatar
    Join Date
    Nov 2008
    Location
    /dev/null
    Posts
    186
    Code:
    void process()
    {
    for (name; <10; name+1)
        printf("Your name is %s/n",name);
    }
    That section has a few bugs in it . . .

    First off . . . for (name; <10; name+1) is incorrect. Try for (; name<10; name++) instead.

    Now, printf("Your name is %s/n",name); again, has a bit of a problem. I'll let you find it, but one tip: /.

    Also, what's that return 1; doing there?

    Remember that bash is the opposite of C: 0 is true, successful, and !0 is false, unsuccessful. Just to confuse you some more. :P

    EDIT: A-whoops-a-dasies. Didn't notice the double post. My apologies.
    Last edited by Nightowl; 03-22-2009 at 09:03 PM.
    Do as I say, not as I do . . .

    Experimentation is the essence of programming. Just remember to make a backup first.

    "I'm a firm believer that <SomeGod> gave us two ears and one mouth for a reason - we are supposed to listen, twice as much as we talk." - LEAF

    Questions posted by these guidelines are more likely to be answered.

    Debian GNU/Linux user, with the awesome window manager, the git version control system, and the cmake buildsystem generator.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. For Loop Disaster
    By Chalmers86 in forum C Programming
    Replies: 3
    Last Post: 03-22-2009, 05:20 PM
  2. Tsunami disaster.
    By anonytmouse in forum A Brief History of Cprogramming.com
    Replies: 23
    Last Post: 01-09-2005, 09:56 AM
  3. NTFS disaster recovery
    By -=SoKrA=- in forum Tech Board
    Replies: 20
    Last Post: 04-17-2004, 02:16 AM
  4. Class + Union + Struct = Disaster??
    By Inquirer in forum C++ Programming
    Replies: 5
    Last Post: 10-28-2002, 03:55 PM
  5. disaster relief
    By iain in forum A Brief History of Cprogramming.com
    Replies: 1
    Last Post: 09-13-2001, 08:12 PM

Tags for this Thread