#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2010
    Posts
    1
    Rep Power
    0

    Question Copy the code from text file to command prompt


    hi every one..

    Please I want help from you..

    first I hope to undrestand my English word because Iam Arabic girl and not so good in English...

    my problem is:

    I wrote code in .c file and I run that code on the prompt command, its ture but I want after the out put copy the code on the command by some statment in the code , how can I do that??

    please help me
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2005
    Location
    London, UK
    Posts
    111
    Rep Power
    15
    I don't really understand what it is you're asking. Do you want to output the source code to the terminal? Can't you just use the "cat" command for this? For example, if your program was called "foo", you could run it and then print the source code with

    $ ./foo; cat foo.c

    Note the semi-colon separating the two command lines. Is this what you want? If not, can you give a more detailed explanation please?
  4. #3
  5. No Profile Picture
    Grumpier old Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jun 2003
    Posts
    14,439
    Rep Power
    4539
    If you just want to copy and paste you can use gnome terminal in linux or putty in windows, both support copy/paste to and from a command line.
    ======
    Doug G
    ======
    Bartender to Rene Descartes "have another beer?" Descartes: "I think not" and he vanished.
    --Alfred Bester
  6. #4
  7. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2011
    Location
    Southampton,PA,USA
    Posts
    4
    Rep Power
    0

    Copy the code from text file to command prompt


    $ cat hello.c
    foo()
    {
    printf "Hello World";
    }

    $ gcc hello.c

    this code may help you to write and compile c program in Linux command prompt.

IMN logo majestic logo threadwatch logo seochat tools logo