Questions tagged [fgets]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
3
votes
1answer
346 views

pset2 Crack - Looping through fgets

I'm trying to loop through a text file (seven lines in the file, with aaaa, aaab, aaac, etc listed) with password guesses for pset2 Crack. I am able to open the file, and iterate through the lines. ...
1
vote
1answer
2k views

Help with fseek and fgets

I am trying to fully grasp how these functions work. From the Reference50 website: fseek FILE* out = fopen("out.txt", "w+"); fputs("Team Bowden Fever!", out); char buffer[50]; fseek(out, 0, ...
0
votes
1answer
1k views

malloc and fgets

#include<stdio.h> #include<cs50.h> int main(void) { char* s= malloc(sizeof(char)*5)); //allocating 5 bytes fgets(s,6,stdin); //allocating 5 bytes for hello and 1 byte for '\0'...
0
votes
1answer
434 views

PSET4: fgets returns odd characters instead of what's in .raw

I know the first few lines of 'card.raw' are (by opening in a texteditor): bit.ly/18gECvy ˇÿˇ‡JFIFHHˇ€Cˇ€Cˇ¿Vˇƒ Currently all I want the app to do is print back what's in the .raw file, and then ...