Where is the output ofter the compilation?

Discussion in 'Programming/Scripts' started by full_adder, Mar 11, 2007.

  1. full_adder

    full_adder New Member

    Hi

    I have written a samle C program, named T1.c :
    #include<stdio.h>
    int main(){
    printf("Hello...");
    return 0;
    }

    and Isaved it in a special directory named Testing in / Desktop/Testing.
    then I comiled with:

    [root@localhost Testing]# cc T1.c
    [root@localhost Testing]# ls
    a.out T1.c

    Now, how can I see the output, which is : Hello...

    thanks
     
  2. martinfst

    martinfst Member Moderator

    cc default output is a.out. So you need to execute a.out. You'd have to do two commands
    Code:
    chmod +x a.out
    ./a.out
    , but I'm not 100% sure the 1st one is needed. It's used to give execute permissions to a file. You can check if they already exists with
    Code:
    ls -l a.out
    If you see 'x' in the beginning of the line, it's already oke.
     
  3. full_adder

    full_adder New Member

    Many thanks for your help.
     

Share This Page