how to allow uppercase characters to be accepted in my password

hello, ,my name is coulton, i am trying to allow either uppercase or lowercase inputs into my code. i can type a password and it will work but it wont let me type uppercase instead.


#include <stdio.h>
#include <string.h>
#include <iostream>


int i;

void main(void)
{
char szPassword[] = "password";
char szUserinput[128];


printf("please enter your password > ");
gets(szUserinput);


if (strcmp(szUserinput,szPassword) == 0)
{printf("oh boy! your're in! Good Job\n");
}
else
{printf("\7Jerk, wrong password.\n");
}
fflush(stdin);
getchar();

}
Having case sensitive passwords is often preferred because that makes the passwords stronger.

If you want case insensitive passwords you can convert both strings to lower case before doing the comparison. C++ has the function std::tolower that yu can use to convert a single char to lower case.
thanks alot i took sometime to think about and realized that it was a futile effort to even try when most are case sensitive anyways.
Topic archived. No new replies allowed.