the if condition: if(strcmp(emp.name, empname)==0) is not satisfied in this code.
i have tried the same code with a binary file with DAT extension then the code works.
Type: Posts; User: abhishekabby
the if condition: if(strcmp(emp.name, empname)==0) is not satisfied in this code.
i have tried the same code with a binary file with DAT extension then the code works.
yeah this will definitely remove the continuous printing of the "name not found statement", but the success of name comparison is not achieved.
i didnt follow you.
i know that the line: no match found will be printed in any case, but the problem here is that while part is never effected , even if the name exists in the details.txt.
i am writing a code to modify the information in a file. the code snippet for the same is:
/************************MODIFY THE RECORD************************************/
void modify(void)
{
...
hey i got the correct output. i changed the code from:
while(fread(&emp, sizeof(struct _emp), 1, fp)==1)
printf("%s\t\t\t%d\t%f", emp.name, emp.age, emp.salary);
to
...
how am i suppose to correct it??
this is my actual output.
MENU.
=====
1. Enter the details into the file
2. Display the...
this is just the snippet.
the inappropriate here means:
if the file contains values:
name age salary
abby 23 27000
ashi 22 12345
then...
i wrote a program which performs the following functions:
1> read the content.
2> display the content.
in my second part, the out put i am getting is not appropriate. my code snippet for the...