Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: tris2006 on August 03, 2006, 03:54:46 am

Title: Simple Question
Post by: tris2006 on August 03, 2006, 03:54:46 am
Ok im a noob to C++ programming and this is my first post here. So dont flame me too bad if this seems like a dumb question. :P
Just to tell you how big a noob I am, I just got out of the hello world phase a little while ago. ;) Anyway heres my question.
I am trying to make some kind of very simple command prompt thingy. Heres some code:
Code
{
    char name[25];

    cout<<"Welcome\n";
    cout<<"\n->";
    cin.getline ( name, 25 );

    if ( strcmp ( name, "test" ) == 0 )
    {
        cout<<"Test completed. System working normally.\n";
    }
    if ( strcmp ( name, "help" ) == 0 )
    {
        cout<<"List of commands:\n";
        cout<<"test,help";
    }
}
how would I make the program jump back to the starting point after the end of every if statement instead of returning 0 and ending?
Title: Re: Simple Question
Post by: Ceniza on August 03, 2006, 04:34:48 am
Sorry but we don't answer programming questions unrelated to Code::Blocks itself, and posting in "Using Code::Blocks" has nothing to do with it... really.

Unfortunately I don't know a place to point you to so you can ask there.

I'll just give you an advice: read from a good tutorial or book everything related to loops... and try to find a good forum for programming questions :wink:

BTW... don't you wonder if this thread is deleted by an administrator in a few hours :D
Title: Re: Simple Question
Post by: tris2006 on August 03, 2006, 04:39:01 am
ah. ok sorry about that. Will try to look into it more.
Thanks anyway.
Title: Re: Simple Question
Post by: MortenMacFly on August 03, 2006, 06:15:07 am
To get a good answer to your question(s) - and maybe even the best - I recommend posting C/C++ related questions into newsgroups like comp.lang.c and comp.lang.c++.
With regards, Morten.
Title: Re: Simple Question
Post by: Game_Ender on August 03, 2006, 02:35:51 pm
If you like forums more, and pose you question properly you can try www.programmingforums.org.
Title: Re: Simple Question
Post by: Angel Portal on August 04, 2006, 06:10:06 pm

I also like this american magazine.
http://www.ddj.com/
It has some good news about programming world.

Angel Portal