Thread: Password Problems

  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
    Location
    Waterloo, Texas
    Posts
    5,708
    Look here. You cannot compare strings with "=="...
    Code:
    #include <cmath>
    #include <complex>
    bool euler_flip(bool value)
    {
        return std::pow
        (
            std::complex<float>(std::exp(1.0)), 
            std::complex<float>(0, 1) 
            * std::complex<float>(std::atan(1.0)
            *(1 << (value + 2)))
        ).real() < 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, 06: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, 03: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