From 967283a4f1946ec167440557f5599f799c69cae7 Mon Sep 17 00:00:00 2001 From: Angel Dimitriev Date: Sat, 19 Dec 2020 09:56:04 -0500 Subject: Create pointers_basics.cpp --- Sem. 10/pointers_basics.cpp | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 Sem. 10/pointers_basics.cpp (limited to 'Sem. 10/pointers_basics.cpp') diff --git a/Sem. 10/pointers_basics.cpp b/Sem. 10/pointers_basics.cpp new file mode 100644 index 0000000..e3c537a --- /dev/null +++ b/Sem. 10/pointers_basics.cpp @@ -0,0 +1,26 @@ +#include +using namespace std; + +const int SIZE = 5; +int main() +{ + int arr[SIZE] = {9,8,7,6,5}; //arr е променлива от тип const int* + int* ptr = arr; + + cout << arr << endl; // адресът на първата клетка в масива. + cout << ptr << endl; // същият адрес + + cout << *ptr <