Password Problems

This is a discussion on Password Problems within the Windows Programming forums, part of the Platform Specific Boards category; I'm trying to check whats entered in an edit box with the contentes of a file like a password but ...

  1. #1
    Registered User
    Join Date
    Oct 2001
    Posts
    81

    Password Problems

    I'm trying to check whats entered in an edit box with the contentes of a file like a password but this doesn't seem to work right, heres what i have.

    char PassEntered[50];
    char CorrectPass[50];
    FILE *PassChk;
    PassChk = fopen("PassChk.dat", "r");
    fgets(CorrectPass,50,PassChk);
    GetWindowText(pass,PassEntered,50);
    if(CorrectPass == PassEntered)
    {
    SetWindowText(hwnd, "Correct");
    }
    else
    {
    SetWindowText(hwnd, "InCorrect");
    }
    fclose(PassChk);

  2. #2
    Guest Sebastiani's Avatar
    Join Date
    Aug 2001
    Posts
    5,439
    Look here. You cannot compare strings with "=="...
    Code:
    int main(void){srand(time(0));for(double l=rand(),l0=0,l00=0;;l0+=0.1){for(double l000=0;l000
    <1;l000+=.001,l+=((double)rand()/RAND_MAX)/0x64,l00+=((sin(l*0x8*atan(l0)*l000-(l0*0x8*atan
    (l)))*0.5)+0.5)){l00-=floor(l00);for(size_t l0000=0,l00000=(size_t)(0x50*(l00));l0000<l00000;++l0000
    )putchar(0x20);putchar(0x61+(int)((double)rand()/RAND_MAX*0x1a));putchar('\n');}}return 0;}

  3. #3
    Registered User
    Join Date
    Oct 2001
    Posts
    81
    Thanks

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. String compare problems
    By swgh in forum C Programming
    Replies: 5
    Last Post: 11-29-2008, 05:41 AM
  2. No clue how to make a code to solve problems!
    By ctnzn in forum C Programming
    Replies: 8
    Last Post: 10-16-2008, 02:59 AM
  3. Password Problem
    By peckitt99 in forum Windows Programming
    Replies: 6
    Last Post: 11-13-2007, 02:13 AM
  4. Saving my Password in a file
    By Yuri in forum C++ Programming
    Replies: 29
    Last Post: 08-09-2005, 05:33 PM
  5. Random Password Generator v1.0 - download it
    By GaPe in forum A Brief History of Cprogramming.com
    Replies: 3
    Last Post: 08-18-2002, 01:27 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21