Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

Native methods in C++?

  • 25-04-2002 01:00PM
    #1
    Closed Accounts Posts: 43


    Is it possible to use native methods in C++? What I mean is, can you get C++ to execute an MS-DOS command and use the results?


Comments

  • Registered Users, Registered Users 2 Posts: 2,648 ✭✭✭smiles


    what kind of msdos commands?

    you should be able to recreate the command fairly easily in C (look up any manual) and then output the results to a text file, and then intrepret them from there.

    << Fio >>


  • Registered Users, Registered Users 2 Posts: 3,308 ✭✭✭quozl


    its been years but either system() or spawn should do it. Most MSDOS programs return an integer value known as the errorlevel. This will tell you how to program exited, ie successfully, or in flames.
    If you need the msdos programs out put try
    system("myProgram > a.txt");

    which will redirect the output away from STDOUT and into a.txt, which you can read like a normal text file.


Advertisement