Thread: Problem I can't seem to solve

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #2
    Just Lurking Dave_Sinkula's Avatar
    Join Date
    Oct 2002
    Posts
    5,005
    FAQ > How do I... (Level 1) > Get a line of text from the user/keyboard (C)
    FAQ > Explanations of... > Why it's bad to use feof() to control a loop

    Why binary mode for strings? If you really need binary mode, shouldn't you use fread instead of fgets?

    Do you really need clrscr and conio.h?

    [edit]
    Code:
    fgets(temp_user,sizeof(user)+1,login);
    Read one less than the string can hold (even when accounting for the null character), but disguise it to look like it's reading one more than it should?

    Kinda the same thing here:
    Code:
    scanf("%15s", user);
    What's \i?
    Code:
    else printf("\incorrect\n");
    Is login a FILE* or a function?
    Code:
    int login(void){
    
    char user[15];
    char pass[15];
    char temp_user[17];
    char temp_pass[17];
    int sw_ok=1;
    FILE *login;
    Last edited by Dave_Sinkula; 05-15-2005 at 04:09 PM.
    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.*

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Solve This Problem Within 3 Hr Urgent Need
    By annum in forum C Programming
    Replies: 12
    Last Post: 10-04-2009, 09:56 AM
  2. problem solve
    By coolnarugodas in forum C Programming
    Replies: 7
    Last Post: 04-26-2005, 12:31 PM
  3. Replies: 2
    Last Post: 04-25-2005, 11:59 AM
  4. Bubble Sort / selection problem
    By Drew in forum C++ Programming
    Replies: 7
    Last Post: 08-26-2003, 03:23 PM
  5. problem cant solve please help.
    By sarah in forum C Programming
    Replies: 6
    Last Post: 09-03-2001, 01:32 PM