type: char
[contents]

Contents

Syntax

The syntax for char definitions is:

f++:  
char definitions
char(definitions)
:=(char, definitions)
n++:  
@char definitions
@char(definitions)
@:=(char, 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 char type is used for character values, though note that ExprTk will happily assign any string value to them (one limitation of ExprTk is that it only really works with doubles and strings).

Note: So that ExprTk has direct access to characters (for the sake of convenience), underneath they are actually strings. If you are defining large volumes of characters where memory usage is of concern then std::char uses proper chars underneath, which you can still access from all of f++, ExprTk, Lua and n++, however accessing and setting them with ExprTk is not quite as nice syntactically and not as efficient.

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 char definitions:

option description
const definition of a constant
!exprtk do not register variable with ExprTk
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 char being defined with f++:

char a='i', b='j'
char(x, y, z)
:=(char, separator = ';')

n++ example

Examples of char being defined with n++:

@char a='i', b='j'
@char(x, y, z)
@:=(char, separator = ';')