Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- //Configuration Properties >> C / C++ >> Preporocessor >> Preprocessor Definitions >> _CRT_SECURE_NO_WARNINGS
- int main()
- {
- char buff[10] = {0}; //Stored on stack, variables get memory allocated on the stack when they are called
- strcpy(buff, "This String Will Overflow the Buffer");
- //Heap example
- int* ptr = new int[10];
- //Needs to have memory alocated and de-allocated by program code. If it is not handled well it will lead to memory leaks.
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement