This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; matrix diag | |
include io.asm | |
; STACK | |
stk segment stack | |
db 32 dup (?) | |
stk ends | |
; DATA | |
data segment | |
n dw ? | |
m dw ? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
int main() | |
{ | |
int* p0 = new int; | |
double* p1 = new double[5]; | |
auto p = new auto ( 7 ); | |
*p0 = 2; | |
p1[*p0] = 5; | |
std::cout << *p << std::endl; // Вывод: 7 | |
std::cout << p1[2] << std::endl; // Вывод: 5 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- build:js(.) scripts/vendor.js --><br> | |
<!-- bower:js --><br> | |
<script src="/bower_components/modernizr/modernizr.js"></script><br> | |
<script src="/bower_components/jquery/dist/jquery.js"></script><br> | |
<!-- endbower --><br> | |
<!-- endbuild --><br> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
int main() | |
{ | |
using std::cout; // компилятор будет использовать std::cout | |
cout << "Hello world!"; // не нужен префикс std:: | |
std::cout << "Hello C++!"; // но при желании std:: можно указать все равно | |
cout << "Hello me!"; // не нужен префикс std:: | |
int x; | |
// cin>>x; без std:: вызовет ошибку | |
std::cin>>x; // Но для std::cin мы ничего не указывали, префикс указываем! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
int main() | |
{ | |
using namespace std; // компилятор будет использовать все из std | |
cout << "Hello world!" << endl; // не нужен префикс std:: | |
std::cout << "Hello C++!" << endl; // но при желании std:: можно указать все равно | |
cout << "Hello me!" << endl; // не нужен префикс std:: | |
int x; | |
cin>>x; // не нужен префикс std:: | |
std::cin>>x; // но при желании std:: можно указать все равно |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int* q = nullptr; // Ok, C++11 | |
int* p = 0; // Ok | |
int* r = NULL; // Ok, NULL == 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
int main() | |
{ | |
using namespace std; | |
char x = 'a'; | |
int y = 7; | |
void* data = &x; | |
char* ptr1 = ( char* ) data; | |
data = &y; | |
int* ptr2 = ( int* ) data; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const int* ptr_to_const = nullptr; // Указатель на константу | |
int* const constant_ptr = nullptr; // Константный указатель |
OlderNewer