just wondering about compiling c programs
i typed in and ran a program which i called hello.c
the program compiled and ran successfully, i saved this program to a folder on my computer. it created an executable file called a.out. when i tried to compile another program which i called fahr.c it compiled, but when i listed the contents of my folder there were only 3 files. a.out, fahr.c and hello.c.
when i ran a.out it ran the file which i had last compiled fahr.c.
just wondering what i should do if i want to have multiple files in the same directory?
one thing i will add is that when i compiled my second program like this
it created an executable file called a1.out
and when i listed the contents of the folder where i am storing my files,
there were four files in the folder.
just wondering if this is how i should be compiling my programs?
i typed in and ran a program which i called hello.c
the program compiled and ran successfully, i saved this program to a folder on my computer. it created an executable file called a.out. when i tried to compile another program which i called fahr.c it compiled, but when i listed the contents of my folder there were only 3 files. a.out, fahr.c and hello.c.
when i ran a.out it ran the file which i had last compiled fahr.c.
just wondering what i should do if i want to have multiple files in the same directory?
one thing i will add is that when i compiled my second program like this
Code:
gcc fahr.c -o a1.out
it created an executable file called a1.out
and when i listed the contents of the folder where i am storing my files,
there were four files in the folder.
just wondering if this is how i should be compiling my programs?