Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
CTasks2
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
elijah vasquez
CTasks2
Commits
b5550a50
Commit
b5550a50
authored
Jan 14, 2023
by
elijah vasquez
🦍
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
changes made to ex 4
parent
ed343199
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
5 deletions
+11
-5
arrayboundaryoverrun.c
arrayboundaryoverrun.c
+11
-5
arrayboundaryoverrun.exe
arrayboundaryoverrun.exe
+0
-0
No files found.
arrayboundaryoverrun.c
View file @
b5550a50
...
@@ -3,22 +3,23 @@
...
@@ -3,22 +3,23 @@
int
main
(
void
)
{
int
main
(
void
)
{
int
a
[]
=
{
1
,
1
,
1
,
1
};
int
a
[
6
]
=
{
1
,
1
,
1
,
1
,
1
,
1
};
int
b
[]
=
{
2
,
2
,
2
,
2
};
int
b
[
6
]
=
{
2
,
2
,
2
,
2
,
2
,
2
};
int
c
[
4
]
=
{
4
,
4
,
4
,
4
};
for
(
int
i
=
0
;
i
<
4
;
i
++
)
for
(
int
i
=
0
;
i
<
6
;
i
++
)
{
{
printf
(
"array a[%d] %d at address %p
\n
"
,
i
,
a
[
i
],
&
a
[
i
]);
printf
(
"array a[%d] %d at address %p
\n
"
,
i
,
a
[
i
],
&
a
[
i
]);
}
}
printf
(
"
\n
"
);
printf
(
"
\n
"
);
for
(
int
i
=
0
;
i
<
4
;
i
++
)
for
(
int
i
=
0
;
i
<
6
;
i
++
)
{
{
printf
(
"array b[%d] %d at address %p
\n
"
,
i
,
b
[
i
],
&
b
[
i
]);
printf
(
"array b[%d] %d at address %p
\n
"
,
i
,
b
[
i
],
&
b
[
i
]);
}
}
printf
(
"
\n
"
);
printf
(
"
\n
"
);
for
(
int
i
=
0
;
i
<
8
;
i
++
)
for
(
int
i
=
-
2
;
i
<
10
;
i
++
)
{
{
b
[
i
]
=
3
;
b
[
i
]
=
3
;
printf
(
"setting array b[%d] to %d at address %p
\n
"
,
i
,
b
[
i
],
&
b
[
i
]);
printf
(
"setting array b[%d] to %d at address %p
\n
"
,
i
,
b
[
i
],
&
b
[
i
]);
...
@@ -37,6 +38,11 @@ for (int i=0;i<4;i++)
...
@@ -37,6 +38,11 @@ for (int i=0;i<4;i++)
}
}
printf
(
"
\n
"
);
printf
(
"
\n
"
);
for
(
int
i
=
0
;
i
<
4
;
i
++
)
{
printf
(
"array c[%d] %d at address %p
\n
"
,
i
,
b
[
i
],
&
b
[
i
]);
}
printf
(
"
\n
"
);
return
0
;
return
0
;
}
}
...
...
arrayboundaryoverrun.exe
0 → 100644
View file @
b5550a50
File added
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment