I am trying to learn how to program using just a text editor and terminal on mac. I was trying to use textEdit as text editor and I even changed the format to plain text so that it doesn't use the rtf format but even after saving it with .c extension, each time i use the gcc hello.c -o main command on terminal it shows this:
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
Is it because we can't use textEdit for this purpose? and if so, why can't we use it?
The problem is not with TextEdit not saving the file correctly, but that you don“t seem to have a correctly installed compiler. Try installing XCode and its command line tools from the Mac App Store.