Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
PPC
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Vojtěch Novotný
PPC
Commits
789a4537
Commit
789a4537
authored
3 weeks ago
by
Vojtěch Novotný
Browse files
Options
Downloads
Patches
Plain Diff
Update
parent
4b8b3c87
No related branches found
Branches containing commit
No related tags found
1 merge request
!2
DU
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
cviceni/2_c/priklad01.cpp
+22
-2
22 additions, 2 deletions
cviceni/2_c/priklad01.cpp
with
22 additions
and
2 deletions
cviceni/2_c/priklad01.cpp
+
22
−
2
View file @
789a4537
...
...
@@ -6,6 +6,21 @@ class TridaA
// metody(funkce)
public:
int
hodnota
;
TridaA
(
int
x
)
{
hodnota
=
x
;
std
::
cout
<<
"Konstruktor TridaA2
\n
"
;
}
TridaA
()
{
hodnota
=
10
;
std
::
cout
<<
"Konstruktor TridaA1
\n
"
;
}
~
TridaA
()
{
std
::
cout
<<
"Destruktor TridaA
\n
"
;
}
};
struct
TridaB
...
...
@@ -14,10 +29,15 @@ struct TridaB
int
main
()
{
TridaA
a
;
a
.
hodnota
=
10
;
TridaA
a
,
b
(
5
);
TridaA
*
c
=
new
TridaA
(
10
);
std
::
cout
<<
"a.hodnota = "
<<
a
.
hodnota
<<
std
::
endl
;
std
::
cout
<<
"b.hodnota = "
<<
b
.
hodnota
<<
std
::
endl
;
std
::
cout
<<
c
->
hodnota
<<
std
::
endl
;
delete
c
;
return
0
;
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment