C++

Packages
#include 
#include 
#include 
using std::cout;
using std::cin;
using std::sqrt;
// std::fixed
// std::scientific
// std::dec
// std::hex
// std::oct
// std::showbase
// std::setw(n)
// std::setfill(ch)

using namespace std;


C++ 11
// Initialization
int count1 {15};
int count2 {3};
int total_Count {count1 + count2};

// other ways:
int count1(15);
int total(count1 + count2);
int count3{2}, count4{6}, count5{1};

double value1 {3.5};
double value2 {5.3};
int whole_number {static_cast(value1) + static_cast(value2)};

char32_t letter {U'B'};
char32_t spec_letter {U'\x044f'};
wchar_t  spec_w {L'\x0438'}; // same as spec_letter above
wchar_t  wletter {L'Z'};

// to check the value of char
char ch {'A'};
char ch2 {ch + 5};
std::cout << "ch is: " << ch
     << " its code is " << std::hex << std::showbase
     << static_cast(ch) << std::endl;
Useful Links
Examples


No comments:

Post a Comment