Skip to content

Instantly share code, notes, and snippets.

@irinkaS
irinkaS / rus_in_console_app_code_blocks
Last active August 29, 2015 14:11
Way to write output in russian in console app in CodeBlocks 13.12
// Следить, чтобы файл был сохранен в кодировке windows-1251 (внизу IDE указана
//текущая кодировка. Можно выставить в Settings-Editor-Other Settings
// Use encoding when opening files: Windows-1251
// и галку в as default encoding
#include <iostream>
#include <Windows.h>
using namespace std;
int main()
@irinkaS
irinkaS / name_assignment
Created December 17, 2014 18:24
Соглашение по именованию
nVar - int
lVar - long
fVar - float
dVar - double
cVar - character
szVar - string
@irinkaS
irinkaS / increment
Created December 17, 2014 18:32
i++ and ++i
int n1, n2, n3;
n1 = 5;
n2 = ++n1; // n1 = 6, n2 = 6
n1 = 5;
n3 = n1++; // n1 = 6, n3 = 5
@irinkaS
irinkaS / increment2
Created December 17, 2014 18:53
i++ and ++i continue
int n1, n2, n3;
n1 = 5;
bool b = (n1>4) && n1++>5;
cout << b << "\n"; // b = true && false = false (0)
cout << n1 << "\n"; //n1 = 6
n1 = 5;
bool b = (n1>4) && ++n1>5;
cout << b << "\n"; // b = true && true = true (1)