Find the answer to your Linux question:
Results 1 to 6 of 6
hi . Can anyone tell me how to use the linux commands while writing a c program. eg we are writing a program and we need to find out the ...
  1. #1
    Just Joined!
    Join Date
    Jun 2008
    Posts
    5

    Unhappy how to use linux commands in a cprogram?

    hi .

    Can anyone tell me how to use the linux commands while writing a c program. eg we are writing a program and we need to find out the total cpu usage during its execution so how we'll be implementing it.

  2. #2
    Just Joined! Gabries's Avatar
    Join Date
    Jul 2007
    Posts
    1
    Quote Originally Posted by goodsp_007 View Post
    Can anyone tell me how to use the linux commands while writing a c program. eg we are writing a program and we need to find out the total cpu usage during its execution so how we'll be implementing it.
    Could you be a little clearer in what you need? What do you mean with "linux commands"? If you want to run some command from a console (or that runs in one), use:
    system("command");
    where command is the code to be run in the console.

  3. #3
    Linux Engineer khafa's Avatar
    Join Date
    Apr 2008
    Location
    Tokyo, Japan
    Posts
    858
    you can also use the exec functions family. more sophisticated but a bit more complicated. check them out with your C programming reference
    Linux and me it's a love story

  4. #4
    Just Joined!
    Join Date
    Jun 2008
    Posts
    5

    same prob.

    I didnt got what u said.
    i need to make a c program in simple terms and need to find the total memory usage during execution.After that i have to print the o/p to on the Jsp Or Php or any presentsble language page.
    thus in that form I was wondering as how to use the linux commands.

  5. #5
    Just Joined!
    Join Date
    Jun 2008
    Posts
    5
    i need to make a c program in simple terms and need to find the total memory usage during execution.After that i have to print the o/p to on the Jsp Or Php or any presentsble language page.
    thus in that form I was wondering as how to use the linux commands.

  6. #6
    Linux Engineer khafa's Avatar
    Join Date
    Apr 2008
    Location
    Tokyo, Japan
    Posts
    858
    hi,


    here is a good article on the matter. read it and you will be up and pimping. lol
    commands from C prog
    Linux and me it's a love story

Posting Permissions

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