Questions tagged [fscanf]
The fscanf tag has no usage guidance.
7 questions
0
votes
1
answer
23
views
cs50 pset5 not enough memory
I have been stuck here for several days. After loading 52209 words, I keep encountering Segmentation fault (core dumped). I think that I am consuming memory unnecessarily somewhere in the code, but I ...
0
votes
1
answer
46
views
Why is fscanf giving me an undefinedbehavioursanitiser error?
my code looks like
int main(void)
{
char word[45];
FILE *dictionary = fopen("dictionary/small", "r");
fscanf(dictionary, "%10s", word);
fclose(dictionary);
}
Inside of ...
1
vote
1
answer
1k
views
PSET5 speller (load) - fscanf function error
When I used the fscanf function in the while loop i get the error; "use of undeclared identifier "word". Heres my while loop:
while(fscanf(fpt, "%s", word)!= EOF)
So first I declared my "word" ...
1
vote
1
answer
448
views
Incorrect counting from fscanf?
Prepping for PSET6 and trying to just load some ints from a file which has 100,000 integers. Easy to check and see for yourself (100K lines, all ints, all separated by a \n).
I'm running fscanf and ...
1
vote
1
answer
105
views
PSET5 Question about pointers
I had a question for dictionary.c. First, I'm still confused at why load and check imput is const char*. I understand that const char* means that the value that char* points to will never change and ...
0
votes
1
answer
150
views
pset5 not loading, why fscanf is not working
Post before suggests that there was some problem with
I malloc dict_word now. However, it still is not loading regarding to vangrid. Coud you possibly share your thoughts?
http://pastebin.com/...
0
votes
1
answer
520
views
Implemention of fscanf and feof
I am working now on pset5, trying to degrade each task into pieces. So now, I have written some code that just reads words from a file I have created, it then prints each word it read. The problem is ...