-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpointer.cpp
More file actions
29 lines (25 loc) · 815 Bytes
/
pointer.cpp
File metadata and controls
29 lines (25 loc) · 815 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#include <iostream>
#include <string>
struct inflatable
{
std::string name;
float volume;
double price;
} matrac = {"Vladov", 1, 233};
double pr_vaha (float, bool);
double pr_vyska (float, float, bool);
int main ()
{
using namespace std;
int sisky = 6;
int * p_sisky = &sisky;
double pohare = 4.5;
double * p_pohare = &pohare;
cout << "Hodnota premennej sisky je : " << sisky << ", a *p_sisky = " << *p_sisky << endl;
cout << "Adresa premennej sisky &sisky = : " << &sisky << ", a p_sisky = " << p_sisky << endl;
cout << "Hodnota premennej pohare je : " << pohare << endl;
cout << "Adresa premennej pohare je : " << &pohare << endl;
cout << "Hodnota premennej matrac je : " << matrac.name << endl;
cout << "Adresa premennej matrac.name je : " << &matrac.name << endl;
return 0;
}