mate i tried changing that code u posted to read the password into another array,but it just aint having it, heres what ive put
Code:
#include <stdio.h>
#include <string.h>
int main(void)
{
FILE *file = fopen("passwords", "r");
if ( file != NULL )
{
char line[80];
char user[5][10];
char userpw[5][10];
size_t count, i = 0;
while ( fgets(line, sizeof line, file) != NULL )
{
if ( sscanf(line, "%9s %s", user[i], userpw[i]) == 1 )
{
if ( ++i >= sizeof user / sizeof *user )
{
break;
}
}
}
fclose(file);
for ( count = i, i = 0; i < count; ++i )
{
printf("user[%d] = \"%s\",Password:%s\n", (int)i, user[i], userpw[i]);
}
}
return 0;
}
also im gunna buy a C book do you recomend any??
cheers