Find the answer to your Linux question:
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 12
Hello I'm new here. I don't have my own pc, so I subscribed for a freeshell online. I don't know what to use in order to type a c code ...
  1. #1
    Just Joined! capt_nemo777's Avatar
    Join Date
    Sep 2008
    Posts
    6

    Question c in ksh help

    Hello I'm new here. I don't have my own pc, so I subscribed for a freeshell online. I don't know what to use in order to type a c code and compile it in a shell. can anyone tell me on how to do it? let's say i have this folder

    /home/nemo/practice

  2. #2
    Linux Engineer RobinVossen's Avatar
    Join Date
    Aug 2007
    Location
    The Netherlands
    Posts
    1,422
    Use GCC to compile code
    New Users, please read this..
    Google first, then ask..

  3. #3
    Just Joined! capt_nemo777's Avatar
    Join Date
    Sep 2008
    Posts
    6

    Question hmmn

    Quote Originally Posted by RobinVossen View Post
    Use GCC to compile code
    how bout the tool i can use in typing c code using the shell itself?
    I don't know what to do and how to save it in the said directory?

  4. #4
    Linux Enthusiast gerard4143's Avatar
    Join Date
    Dec 2007
    Location
    Canada, Prince Edward Island
    Posts
    714
    Are you talking about a editor or an ide to type your code into....if you are then try vi, vim or nano...I find nano is a lot easier to use myself

  5. #5
    Just Joined! capt_nemo777's Avatar
    Join Date
    Sep 2008
    Posts
    6

    Question hello

    Quote Originally Posted by gerard4143 View Post
    Are you talking about a editor or an ide to type your code into....if you are then try vi, vim or nano...I find nano is a lot easier to use myself
    yes sir, am referring to tools inside the shell..i don't have my own pc to be authorized to install such IDE. i tried nano after reading your message.. but how am i going to use the options at the bottom?
    when i type ^X and press enter..it doesn't exit


  6. #6
    Linux Enthusiast gerard4143's Avatar
    Join Date
    Dec 2007
    Location
    Canada, Prince Edward Island
    Posts
    714
    ^x exit is Ctrl x to exit...the symbol ^ is the Ctrl key

    so to exit you would hold the ctrl key down and press x at the same time....Hope this helps

  7. #7
    Just Joined! capt_nemo777's Avatar
    Join Date
    Sep 2008
    Posts
    6

    Question

    Quote Originally Posted by gerard4143 View Post
    ^x exit is Ctrl x to exit...the symbol ^ is Ctrl
    oh ok..i got it working now, by the way i got another question
    well after i got everything working
    i code my first hello world script and was able to compile and run it.
    each time i run it, i still need to place ./ infront of the file name.
    so i did PATH=$PATH:. and it worked fine.

    my question now is..what should i do in order not to type PATH=PATH:. over and over again each time i log to my shell account ?

  8. #8
    Linux Enthusiast gerard4143's Avatar
    Join Date
    Dec 2007
    Location
    Canada, Prince Edward Island
    Posts
    714
    Path= Path I really don't know, I always use ./ before my executables. If you really need an answer I would repost it as a new topic....

  9. #9
    Just Joined! capt_nemo777's Avatar
    Join Date
    Sep 2008
    Posts
    6

    Question its cool

    Quote Originally Posted by gerard4143 View Post
    Path= Path I really don't know, I always use ./ before my executables. If you really need an answer I would repost it as a new topic....
    its cool..by the way sir. why is it that when i compiled the hello.c through
    gcc hello.c
    the output was "a.out"
    why is it like that? and not hello.out ?

  10. #10
    Linux Enthusiast gerard4143's Avatar
    Join Date
    Dec 2007
    Location
    Canada, Prince Edward Island
    Posts
    714
    try
    gcc -o hello hello.c

    and gcc will produce an exe called hello

Page 1 of 2 1 2 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...