Code is here:
#include <stdio.h>
#define NUM 0x11a
int data = NUM;
int main(int argc, char * argv[])
{
    struct{
        unsigned long memoryAddress;
       char array[50];
    } locals;
    locals.memoryAddress= 2;
    scanf("%lx", &locals.memoryAddress);
    scanf("%49s", locals.array);
    printf(locals.array);
    data += 5;
    printf("\n%d\n", data);
    if(data != NUM + 0x5){
        printf("Print me!\n");
    }
    return 0;
}
I should get "Print me!". It's format string attack and I use %n and gdb.
So how can I get memory address of data to overwrite it?
 
    