I want to compile a C source code which I wrote in one directory in another directory. Is it possible like this? If it is possible how do I achieve that?
11 Answer
Try this for compiling.
gcc file.c -o directory/myOutputand run it.
./directory/myOutput if this doesn't work try this for compile and move the output file to a directory.
gcc file.c -o [compiled ouput file] & mv [compiled ouput file] [your directory]