Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

CS50 week 5: Speller

I’m doing cs50x and on week 5’s problem set I keep getting this error message ‘error: incompatible pointer types passing ‘FILE *’ (aka ‘struct _IO_FILE *’) to parameter of type ‘const char *’ [-Werror,-Wincompatible-pointer-types]
while (scanf(file, "%s", word) != EOF)’ when implementing the load function and I can’t quite understand what am I doing wrong… Can someone help me please?

enter image description here

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

I guess you need to replace scanf by fscanf in your load function. Btw, CS50 is a great course. I completed it about a month ago.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading