Search:

Type: Posts; User: jim.rattlehead

Search: Search took 0.01 seconds.

  1. Replies
    23
    Views
    4,606

    I just couldn't work out how to use a loop for...

    I just couldn't work out how to use a loop for this situation.

    I have this:



    void exitquestion()
    {
    char exitquestion;
    printf("\n\nDo you wanna quit?");
  2. Replies
    23
    Views
    4,606

    I tried writing it as a while loop but I couldn't...

    I tried writing it as a while loop but I couldn't work out how to make it work like the above if statements should.

    ie. Do you want to quit? Y/ N

    N then go back to main, repeat the program...
  3. Replies
    23
    Views
    4,606

    I have tried rewriting it several times, and...

    I have tried rewriting it several times, and still the same problem occurs. Here is my latest attempt:



    exitfunction()
    {
    char exitquestion;
    printf("\n\nDo you wanna quit?");
    exitquestion =...
  4. Replies
    23
    Views
    4,606

    Hmm I see. So for a implementation like the above...

    Hmm I see. So for a implementation like the above it is always best to just use a char variable and not an array. Although either way it doesn't seem to be changing the behaviour of the function.
    ...
  5. Replies
    23
    Views
    4,606

    Wow speedy reply! So an array of char[1] is...

    Wow speedy reply! So an array of char[1] is different to a variable of char? Didn't realise that. I now have this, which is similair to my original code:



    exitfunction()
    {
    char...
  6. Replies
    23
    Views
    4,606

    Thanks for the help everyone, have tried this: ...

    Thanks for the help everyone, have tried this:



    exitfunction()
    {
    char exitquestion; /* Local variable for storing question response about quitting. */
    printf("\n\nAre You Sure You...
  7. Replies
    23
    Views
    4,606

    Quick IF statement question (beginner)

    Hi there, I am new to C and I having trouble with this if statement which is called by the main function when the user requests to quit:



    exitfunction()
    {
    char exitquestion[1]; /* Local...
Results 1 to 7 of 7