Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

c kiddies, need your help

Name: Anonymous 2010-04-25 18:53

int main(){
    char data[2][5] = {"root", "pass"};
    char holder[5];
    printf("Please enter your username>");
    gets(holder);
    if(data[1]==holder){
    printf("Correct Username");
    };
    return 0;
}

The problem is even if I type the correct username in it will not pass to
if(data[1]==holder){

Name: Anonymous 2010-04-25 19:33

#include <stdio.h>
int main(void)
{ char data[2][5] = {"root", "pass"},
       *holder = NULL;
  size_t n;
  ssize_t r;
  fputs("Please enter your username>", stdout);
  fflush(stdout);
  r = getline(&holder, &n, stdin);
  holder[r - 1] = 0;
  if(!strcmp(data[1], holder))
    puts("Correct Username");
  return 0; }

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List