Go back to Richel Bilderbeek's homepage.

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

 

 

 

 

 

(C++) RawCharacterStringExample1

 

Technical facts

 

Operating system(s) or programming environment(s)

IDE(s):

Project type:

C++ standard:

Compiler(s):

Libraries used:

 

 

 

 

 

Qt project file: ./CppRawCharacterStringExample1/CppRawCharacterStringExample1.pro

 

TEMPLATE = app
CONFIG += console
CONFIG -= app_bundle
CONFIG -= qt
QMAKE_CXXFLAGS += -std=c++11 -Wall -Wextra -Weffc++ -Werror
SOURCES += main.cpp

 

 

 

 

 

./CppRawCharacterStringExample1/main.cpp

 

#include <cassert>
#include <string>

int main()
{
  const std::string s { R"(/""\)" };
  assert(s.size() == 4);
  assert(s[0] == '/');
  assert(s[1] == '\"');
  assert(s[2] == '\"');
  assert(s[3] == '\\');
  const std::string t { "/\"\"\\" };
  assert(s == t);
}

 

 

 

 

 

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