+ 3
String comparison in C or C++ for password verification. Code will help.
Comparing strings in C or C++
1 ответ
+ 1
use the strcmp() function in the string.h standard header it returns 0 if the strings are the same.
#include <stdio.h>
#include <strings.h>
int main(){
char pasword[] = "historia";
char userinput[19];
scanf("%s", userinput);
if(strcmp(pasword, userinput)==0){
printf("access");
}else{
return 0;
}}