This is a draft cheat sheet. It is a work in progress and is not finished yet.
Shortcuts
ctrl + / |
Comment line |
shift + alt + up/down |
Duplicate line |
alt + up/down |
Move line |
ctrl + [/] |
indent left/right |
|
<vector> (Use vector)
vectorName.push_back() |
add element |
vectorName.pop_back() |
remove last element |
vectorName[ index ] |
access element at index |
vectorName.at( index ) |
access element at index |
vectorName.erase( index ) |
erase element at a index |
vectorName.size() |
find vector size |
.at (better due to bounds checking)
<iostream> (Standard library)
cin >> a,b |
get input |
cout << "Hello" |
print output + endline |
cerr << "Error: warning" |
standard error message |
endl |
endline and move to next line |
flush |
immediately prints the output without buffering |
cin.fail() |
checks if the last input/output operation on a stream failed. |
clog |
|
|
<cmath> (Math operations)
<cstdio> (C style operations)
|