-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPRPC4-1-string.cpp
More file actions
51 lines (41 loc) · 1.01 KB
/
PRPC4-1-string.cpp
File metadata and controls
51 lines (41 loc) · 1.01 KB
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#include <iostream>
#include <cstring>
#include <string>
using namespace std;
int main ()
{
// Vyriesit priradovanie do
struct data {
string meno;
string priezvisko;
string * znamka;
string vek;
};
data ff;
string hod;
int f;
char g;
// Zadanie udajov
ff.znamka = new string;
cout << "Ake je vase krstne meno : ";
getline (cin, ff.meno);
cout << "Ake je vase priezvisko : ";
getline (cin, ff.priezvisko);
cout << "Aku znamku si zasluzite : ";
getline (cin, ff.znamka);
cout << "Kolko mate rokov : ";
getline (cin, ff.vek);
// Konverzia, kde to je potrebné
g = (char) ff.znamka;
f =(int) g;
f = ++f;
cout << "F je : " << f << endl;
hod = string (f);
cout << "hod je : " << hod << " a velkost je " << sizeof hod << endl;
ff.znamka = hod;
// Tlač výsledkov
cout << endl << "Meno : " << ff.meno << ", " << ff.priezvisko << endl;
cout << "Znamka : " << ff.znamka << " a velkost je " << sizeof ff.znamka << endl;
cout << "Vek : " << ff.vek << endl;
return 0;
}