I'm required to run some C Programs for my C Programming class in Terminal. I have never used Terminal before and can't seem to figure out how to do this.
I'm using Xcode as my compiler. I figured out how to get Xcode to make an exe file of my program so that I can use it in Terminal. If I double click on the exe file on my computer, it will run in Terminal, but it does this before I can enter any strings for it to use.
Can someone please guide me through the process of compiling and running the program in Terminal?
Below is an example of what I'm typing in Terminal with no results. Repeat is the name of my program.
John-Smiths-MacBook:desktop smith_j$ ls "/Users/smith_j/Desktop/C Programming Class/repeat 3-27-13 6.49 PM/usr/local/bin/"
John-Smiths-MacBook:desktop smith_j$ "repeat" resistance is futile
-bash: repeat: command not found
This is my program:
int main(int argc, char *argv)
printf("The command line has %d arguments:\n", argc - 1);
for (count = 1; count < argc; count++)
printf("%d: %s\n", count, argv[count]);