1

enter image description here

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 1

5

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:

enter image description here

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.

enter image description here

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.

1
  • Thanks it worked :) :) Commented Mar 22, 2017 at 14:47

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .