Thread: A Little help here

  1. #1
    Registered User
    Join Date
    Jan 2007
    Posts
    8

    Post A Little help here

    hi,,,

    consider this program,
    Code:
    #include<process.h>
    
    int main()
    {
           System("DIR");
           return 0;
    }
    this actually prints the contents of the local directory,, is there any way that i can use the result of that system call...

    ** like storing in a file

    Regards,
    Rajasekaran

  2. #2
    "I Win!" by U. Lose vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,758
    dir > a.txt
    or use the Windows API directly, without using SYSTEM call that is unsecure
    To be or not to be == true

  3. #3
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    34,692
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  4. #4
    "I Win!" by U. Lose vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,758
    Quote Originally Posted by Salem
    Have I missed something?
    To be or not to be == true

  5. #5
    Its hard... But im here swgh's Avatar
    Join Date
    Apr 2005
    Location
    England
    Posts
    1,649
    Either he's having a funny five minutes or it may of been asked elsewhere. Il let you decide.
    Double Helix STL

Popular pages Recent additions subscribe to a feed
Website Security Test