Thread: C program

  1. #1
    Registered User
    Join Date
    Oct 2004

    C program

    Write a program that determine if a word is in dictionary data file program to do the following:
    Look up word
    Add new word to dictionary
    Print the content of data file (dictionary)

    I need help to start this program i have never put a menu in a program before, so could you please help me.

  2. #2
    & the hat of GPL slaying Thantos's Avatar
    Join Date
    Sep 2001
    int menu(void)
      int selection=-1;
        puts("Welcome to C Programming's Message board\nPlease make your selection\n");
        puts("1) I would like to post some code");
        puts("2) I am a lazy dumb arse");
        puts("3) I'm not sure if I'm being insulted or not");
        puts("4) I could swear void main() was my friend");
        puts("selection: ");
        if ( scanf("%d, &selection) != 1 )
          int ch;
          while ( (ch=getchar()) != ' ' );
          selection = -1;
          if ( selection <= 0 || selection > 4 )
            puts("Wow you really are dumber then you look");
      }while (selection <= 0 || selection > );
      return selection;

  3. #3
    Just Lurking Dave_Sinkula's Avatar
    Join Date
    Oct 2002

    if ( scanf("%d", &selection) != 1 )
    Missing closing double-quote.

    }while (selection <= 0 || selection > 4? );
    Missing condition.

    7. It is easier to write an incorrect program than understand a correct one.
    40. There are two ways to write error-free programs; only the third one works.*

  4. #4
    & the hat of GPL slaying Thantos's Avatar
    Join Date
    Sep 2001
    [cover up]Of course they could be intentionally induced errors to keep people from copy/pasting[/cover up]

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Issue with program that's calling a function and has a loop
    By tigerfansince84 in forum C++ Programming
    Replies: 9
    Last Post: 11-12-2008, 12:38 PM
  2. Need help with a program, theres something in it for you
    By engstudent363 in forum C Programming
    Replies: 1
    Last Post: 02-29-2008, 12:41 PM
  3. Replies: 4
    Last Post: 02-21-2008, 09:39 AM
  4. My program, anyhelp
    By @licomb in forum C Programming
    Replies: 14
    Last Post: 08-14-2001, 10:04 PM
Website Security Test