Commit e8a66070 authored by Kevin Höllring's avatar Kevin Höllring
Browse files

Fix wrong type of gcc specific types

parent 8d764072
......@@ -2,70 +2,65 @@
int main(int argc, char** arguments) {
// A value that can be true or false
bool flag = false;
// A value that can be true or false
bool flag = false;
// Integer values
// Integer values
// An 8 bit signed integer, -128 to 127 in value
char first_variable = 0;
// An 8 bit unsigned integer, 0 to 255 in value
unsigned char second_variable = 1;
// An 8 bit signed integer, -128 to 127 in value
char first_variable = 0;
// An 8 bit unsigned integer, 0 to 255 in value
unsigned char second_variable = 1;
// An 16 bit signed integer, -2^15 to 2^15-1 in value
short third_variable;
// An 16 bit unsigned integer, 0 to 2^16-1 in value
unsigned short fourth_variable;
// An 16 bit signed integer, -2^15 to 2^15-1 in value
short third_variable;
// An 16 bit unsigned integer, 0 to 2^16-1 in value
unsigned short fourth_variable;
// An 32 bit signed integer, -2^31 to 2^31-1 in value
int fifth_variable;
// An 32 bit unsigned integer, 0 to 2^32-1 in value
unsigned int sixth_variable;
// An 32 bit signed integer, -2^31 to 2^31-1 in value
int fifth_variable;
// An 32 bit unsigned integer, 0 to 2^32-1 in value
unsigned int sixth_variable;
// An 64 bit signed integer, -2^63 to 2^63-1 in value
long long seventh_variable;
// An 64 bit unsigned integer, 0 to 2^64-1 in value
unsigned long long eigth_variable;
// An 64 bit signed integer, -2^63 to 2^63-1 in value
long long seventh_variable;
// An 64 bit unsigned integer, 0 to 2^64-1 in value
unsigned long long eigth_variable;
// Variants in gcc
// Handy to be sure what size the type has and whether it is signed/unsigned
int8_t var1;
uint8_t var2;
// Variants in gcc
// Handy to be sure what size the type has and whether it is signed/unsigned
int8_t var1;
uint8_t var2;
int16_t var3;
uint16_t var4;
int16_t var3;
uint16_t var4;
int32_t var5;
uint32_t var6;
int32_t var5;
uint32_t var6;
int64_t var7;
uint64_t var8;
int64_t var7;
uint64_t var8;
// Special gcc feature: even larger integers
// Warning: These cannot normally be written to cout/cerr
// and many common operations might not be supported
int128_t var9;
uint128_t var10;
// Special gcc feature: even larger integers
// Warning: These cannot normally be written to cout/cerr
// and many common operations might not be supported
__int128_t var9;
__uint128_t var10;
// Floating point types
// 32 bit floating point
float fp_number_1 = 0.1e-6;
// FLT_MIN = 1.175494e-38
// FLT_MAX = 3.402823e+38
// Floating point types
// 64 bit floating point
double fp_number_2 = 1e10;
// DBL_MIN = 2.2250738585072014e-308
// DBL_MAX = 1.7976931348623157e+308
// 32 bit floating point
float fp_number_1 = 0.1e-6;
// FLT_MIN = 1.175494e-38
// FLT_MAX = 3.402823e+38
// Strings of text
std::string text_contents = "Hello world";
// 64 bit floating point
double fp_number_2 = 1e10;
// DBL_MIN = 2.2250738585072014e-308
// DBL_MAX = 1.7976931348623157e+308
// Strings of text
std::string text_contents = "Hello world";
return 0;
}
\ No newline at end of file
return 0;
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment