why notCode:while(c!='\n'){ /*look for newline*/ input[i]=c; /*store in array*/ c=getc(fp_account); /*read next char*/ i++; /*increment counter*/ } /*end while*/ input[i]=0; /*end of string*/ strcpy(account_description[tot_accounts],input);
?Code:fgets(account_description[tot_accounts], sizeof(account_description[tot_accounts]),fp_account);
you will avoid overwriting both input array and account_description[tot_accounts] array