c:c_variables
This is an old revision of the document!
C - C++ Variables
Type | Example | Comment |
---|---|---|
int | 1 | |
long int | 1L | |
long long int | 1LL | |
double | 1.0 | |
float | 1.0F | |
char | '1' | |
char* | “a string” | Automatically terminated with a null character. |
wchar_t* | L“a string” | |
char8_t* | u8“this is a UTF-8 string with a UTF-8 character: u2018” | |
char16_t* | u“this is a UTF-16 string with a UTF-16 character: u2018” | |
char32_t* | U“this is a UTF-32 string with a UTF-32 character: U00002018” | |
bool | true, false | |
binary | 0b101 | C++ 2014 standard. |
Declarations
Declarations use both intrinsic and user-defined types. The intrinsic types are:
[<signed | unsigned >]char [<signed | unsigned >]wchar_t [<signed | unsigned>] [<short | long | long long>] int float [long] double bool
c/c_variables.1612974673.txt.gz · Last modified: 2021/02/10 16:31 by peter