Go back to Richel Bilderbeek's homepage.

Go back to Richel Bilderbeek's C++ page.

 

 

 

 

 

(C++) StdSystemExample1

 

Technical facts

 

Operating system(s) or programming environment(s)

IDE(s):

Project type:

C++ standard:

Compiler(s):

Libraries used:

 

 

 

 

 

Qt project file: ./CppStdSystemExample1/CppStdSystemExample1.pro

 

include(../../ConsoleApplication.pri) #Or use the code below
# QT += core
# QT += gui
# greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
# CONFIG   += console
# CONFIG   -= app_bundle
# TEMPLATE = app
# CONFIG(release, debug|release) {
#   DEFINES += NDEBUG NTRACE_BILDERBIKKEL
# }
# QMAKE_CXXFLAGS += -std=c++11 -Wall -Wextra -Weffc++
# unix {
#   QMAKE_CXXFLAGS += -Werror
# }

SOURCES += main.cpp

 

 

 

 

 

./CppStdSystemExample1/main.cpp

 

#include <cstdlib>

int main()
{
  std::system("dir *.* > output.txt");
  std::system("type output.txt"); //On Windows
}

/* Screen output:

Volume in drive D is DATA
Volume Serial Number is 6E49-4539

Directory of D:\Projects\Test\build-CppStdSystemExample1-Desktop_Qt_5_1_1_MinGW
_32bit-Debug

03/20/2014  03:39 PM    <DIR>          .
03/20/2014  03:39 PM    <DIR>          ..
03/20/2014  03:40 PM    <DIR>          debug
03/20/2014  03:39 PM            11,221 Makefile
03/20/2014  03:39 PM             7,666 Makefile.Debug
03/20/2014  03:39 PM             7,740 Makefile.Release
03/20/2014  03:41 PM                 0 output.txt
03/20/2014  03:39 PM    <DIR>          release
               4 File(s)         26,627 bytes
               4 Dir(s)  202,344,755,200 bytes free
Press <RETURN> to close this window...

*/

 

 

 

 

 

Go back to Richel Bilderbeek's C++ page.

Go back to Richel Bilderbeek's homepage.

 

Valid XHTML 1.0 Strict

This page has been created by the tool CodeToHtml