Quantcast
Channel: Active questions tagged html - Stack Overflow
Viewing all articles
Browse latest Browse all 67527

Comparing string in file

$
0
0

I am trying to print this line of code to the HTML file when my file reads the character "form". However, I keep failing and I have no idea how to do it. Please help

fgets(str,999,p);

while (!feof(p)) {
    if (strstr("form", str) != NULL) {
        printf("<input type=\"hidden\" name=\"gold\" value=\"%d\"", goldpieces);
    }

    printf("%s", str);
    fgets(str,999,p);
}

fclose(p);
return 0;

Viewing all articles
Browse latest Browse all 67527

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>