type: std::string
[contents]

Contents

Syntax

The syntax for std::string definitions is:

f++:  
std::string definitions
std::string(definitions)
:=(std::string, definitions)
n++:  
@std::string definitions
@std::string(definitions)
@:=(std::string, definitions)

Note: If you are using the first syntax for variable definitions and want to have more code and/or text following on the same line then simply end the definition with ';'.

Description

The std::string type is used for string variables.

Note: ExprTk does not have direct access to variables of type std::string, if you want the convenience and efficiency of direct access then use string.

Note: If you need to define thousands of variables then := is faster, plus it has useful error messages for unrecognised types.

Options

The following options are available for std::string definitions:

option description
const definition of a constant
layer="x" define variable at layer x
private definition of a private
scope+="x" add x to scopes variable can be accessed from
option description

f++ example

Examples of std::string being defined with f++:

std::string a="cat", b="dog"
std::string(x, y, z)
:=(std::string, str = "hello, world!")

n++ example

Examples of std::string being defined with n++:

@std::string a="cat", b="dog"
@std::string(x, y, z)
@:=(std::string, str = "hello, world!")