Initial commit
This commit is contained in:
25
cpp/Основы/переменные.cpp
Normal file
25
cpp/Основы/переменные.cpp
Normal file
@@ -0,0 +1,25 @@
|
||||
#include <iostream>
|
||||
|
||||
using namespace std;
|
||||
|
||||
int main() {
|
||||
/*
|
||||
Синтаксис: тип имя;
|
||||
или: тип имя = значение;
|
||||
*/
|
||||
|
||||
int myInt;
|
||||
myInt = 5;
|
||||
float myFloat = 6.23;
|
||||
double myDouble = 6.2340282;
|
||||
|
||||
// Pointers
|
||||
int *myPointer;
|
||||
myPointer = &myInt; // создание ссылки
|
||||
cout << "Значение из указателя: " << *myPointer << endl; // Получение значения из ссылки
|
||||
|
||||
// None
|
||||
myPointer = nullptr;
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user