Как говорили все люди в c для сравнения строк, используйте strncmp
или используйте pointers
.
#include <stdio.h>
#include <string.h>
int main ()
{
FILE * pFile;
char tag [6];
char code[20]="bill";
pFile = fopen ("example.asm","r+");
if (pFile==NULL)
{
perror("Error");
}
else
{
while(!feof(pFile))
{
fgets(tag,5,pFile);
if((strncmp(tag, "<bp>") == 0) && (!feof(pFile)))
{
fputs(code,pFile);
}
}
}
fclose(pFile);
return 0;
}