i just started CS50 and i am in week 1 however when i type in CS50 IDE and save file as hello.c, it never gets compiled.i used update50 command to make sure i am updated and checked the directory but i also have the same error
why is this error happening ??
1 Answer
This will happen if you accidentally saved the file name as "hello.c " (with a space following the c).
First, the icon for hello.c in the file tree shows as a text file. It should show as a C file like this:
Second, there is no C syntax highlighting in the hello.c window.
Suggest you
File > Save As hello.c
(be careful to type it exactly). You should then see two "hello.c" files in the file tree.
Right-click -> delete the hello.c that shows with the text icon. It will ask a confirmation message, and close the open editor pane. Double click on hello.c
(with the C icon). It will open in the editor window, and now you should be able to compile.