Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
- void fonc2(char * result) {
- strcpy(result, "TOTO"); // Overwrites the pointed to by result
- result[0]= 0x41; // This is (hopefully not) crashing...
- printf("%s %p\n", result, (void *)&result);
- }
- void main() {
- char toto[] = "TRUC";
- fonc2(toto);
- printf("%s %p\n", toto, (void *)&toto);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement