Advertisement
Guest User

Untitled

a guest
Aug 15th, 2018
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.47 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <string.h>
  3. #include <stdlib.h>
  4.  
  5. int check(char *password){
  6.     char a[100];
  7.     strcpy(a, password);
  8.     if(strcmp(a, "password12345")==0){
  9.         printf("Correct : %s \n", a);
  10.     }else{
  11.         printf("False: %s \n", a);
  12.     }
  13.     return 0;
  14. }
  15.  
  16. int main(int argc, char *arguments[]){
  17.     if(argc < 2){
  18.         printf("too few arguments\n");
  19.         exit(0);
  20.     }
  21.     check(arguments[1]); //<--- here this part, arguments[1] is supposed to be a string, not a character
  22.     return 0;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement