Mine
public text v1 · immutable#include <iostream>
using namespace std;
int main(int argc, char *argv[]) {
unsigned char b = -1;
char c[20];
cout << "Enter input: ";
gets(c);
printf("Array: %s, memory offset of array: %X\n", c, c);
for (int i = 0; i < sizeof(c); i++) {
printf("Current value: %c, current memory address: %X\n", c[i], &c[i]);
}
cout << "Memory range in area of c:" << endl;
int *j = (int*) c-20;
for (; j < (int*)c+sizeof(c)+20; j++) {
printf("%X\t\t%c\n", j, *j);
}
return 0;
}