Go back to Richel Bilderbeek's homepage.

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

 

 

 

 

 

(C++) StdTmpnamExample1

 

Technical facts

 

Operating system(s) or programming environment(s)

IDE(s):

Project type:

C++ standard:

Compiler(s):

Libraries used:

 

 

 

 

 

Qt project file: ./CppStdTmpnamExample1/CppStdTmpnamExample1.pro

 

TEMPLATE = app
CONFIG += console
CONFIG -= app_bundle
CONFIG -= qt

SOURCES += main.cpp

 

 

 

 

 

./CppStdTmpnamExample1/main.cpp

 

#include <iostream>
#include <cstdio>
#include <string>

int main()
{
  for (int i=0; i!=10; ++i)
  {
    const std::string s = std::tmpnam(0);
    std::cout << s << '\n';
  }
}

/* Possible screen output:

\s1p4.
\s1p4.1
\s1p4.2
\s1p4.3
\s1p4.4
\s1p4.5
\s1p4.6
\s1p4.7
\s1p4.8
\s1p4.9
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