Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
esimerkit
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
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
tie
ohj1
2023s
esimerkit
Commits
c45c7802
Commit
c45c7802
authored
1 year ago
by
Vesa Lappalainen
Browse files
Options
Downloads
Patches
Plain Diff
varoituksia pois
parent
a2275418
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
luennot/luento16/MuuttujienNakyvyys/MuuttujienNakyvyys.cs
+4
-1
4 additions, 1 deletion
luennot/luento16/MuuttujienNakyvyys/MuuttujienNakyvyys.cs
with
4 additions
and
1 deletion
luennot/luento16/MuuttujienNakyvyys/MuuttujienNakyvyys.cs
+
4
−
1
View file @
c45c7802
...
...
@@ -21,7 +21,7 @@ public class MuuttujienNakyvyys
int
uusi
=
3
;
// muuttuja joka näkyy vain tässä lohkossa
Console
.
WriteLine
(
uusi
);
}
// nyt uusi-muuttuja lakkaa olemasta
//
Nyt m
uuttujaa uusi ei ole olemassakaan
//
M
uuttujaa uusi ei ole
enää
olemassakaan
// Täytetään taulukkoa
int
edellinen
=
0
;
...
...
@@ -32,6 +32,8 @@ public class MuuttujienNakyvyys
luvut
[
i
]
+=
iso
;
edellinen
=
nyt
+
luku
;
// silmukan ulkopuolella määritelty muuttuja
}
Console
.
WriteLine
(
$"
{
d
}
{
edellinen
}
"
);
}
...
...
@@ -48,6 +50,7 @@ public class MuuttujienNakyvyys
int
uusiarvo
;
// aliohjelman lokaali muuttuja
uusiarvo
=
luku
+
3
;
luvut
[
paikka
]
=
uusiarvo
;
// muuttaa pääohjelman taulukkoa
// ReSharper disable once RedundantAssignment
luku
=
12
;
// ei vaikuta pääohjelmaan
}
}
\ 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