I just moved to Ubuntu and am currently learning C programming, so naturally I tried to compile some code. I am sure I'm using the command right (it's just a few letters, come on), but the compiler keeps complaining about there being "no such file or directory", regardless of what directory I try to compile from. I have build-essential installed and gcc seems to be functioning normally otherwise, what could be the cause of this? Help is much appreciated.
Edit: Upon further investigation, I've realised that this happens with .c files I create through an editor, such as the default Ubuntu editor or Atom. The result was succesfull when using the gedit command, but unsuccesfull when creating the same file through an editor. I also saved the files to the home directory and ran
ls every time to make sure that they're there before attempting to compile. Here's the error message:
me@My-PC:~$ gcc test.c gcc: error: test.c: No such file or directory gcc: fatal error: no input files compilation terminated.
Edit2: I was being an idiot and not saving the files as .c (I assumed setting the format to "C" in the editors would do that for me)