Buffer Overflow test.
This commit is contained in:
parent
4bb0b4a247
commit
a7ef300d73
14
main.cpp
14
main.cpp
@ -1,13 +1,13 @@
|
|||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
void print(int x)
|
|
||||||
{
|
|
||||||
std::cout << x;
|
|
||||||
}
|
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
constexpr float testVal { 5.5F };
|
//char name[5] = {'t', 'e', 's', 't', '\0'};
|
||||||
print(static_cast<int>(testVal));
|
char name[5] = "test";
|
||||||
|
char* t = name;
|
||||||
|
std::cout << t;
|
||||||
|
t[1] = 'a';
|
||||||
|
t[4] = 'b';
|
||||||
|
std::cout << t;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user