Go back to Richel Bilderbeek's homepage.

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

 

 

 

 

 

(C++) StdSystemExample2

 

Technical facts

 

Operating system(s) or programming environment(s)

IDE(s):

Project type:

C++ standard:

Compiler(s):

Libraries used:

 

 

 

 

 

Qt project file: ./CppStdSystemExample2/CppStdSystemExample2.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

 

 

 

 

 

./CppStdSystemExample2/main.cpp

 

#include <cstdlib>

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

/* Screen output:

A subdirectory or file tmp already exists.
Volume in drive D is DATA
Volume Serial Number is 6E49-4539

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

03/20/2014  03:43 PM    <DIR>          .
03/20/2014  03:43 PM    <DIR>          ..
03/20/2014  03:43 PM                 0 output.txt
               1 File(s)              0 bytes
               2 Dir(s)  202,344,558,592 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