You are given the following C code:
const char *c = "12345";
Answer the following (assume typical modern 64-bit Linux/macOS with GCC/Clang, unless a behavior is undefined/implementation-defined):
printf("%s", c);
printf("%d", c);
printf("%c", c);
printf("%c", *c);
printf("%c", *(c+1));
c
?
gdb
/
lldb
to inspect:
c
(as an address)
malloc/free
vs
new/delete
in C/C++ (initialization, constructors/destructors, type safety, failure behavior, arrays, etc.).
"12345"
typically reside?
Login required