I'm writing a program with struct Record. As I read in records from text in a loop, I assign them to buffer before saving buffer into the array. nRange is just the total number of records being read.
Record *storage;
storage = (Record*)malloc(nRange*sizeof(Record));
Record buffer;
storage[i] = buffer;
I want to access storage[i] in order to check that the record is being saved to memory, but I can't quite get the syntax. I was trying something like:
printf("%d \n", &storage[i].x);
But I think this is just giving me the address of the x value of the Record at storage[i]. If anyone could give me the exact syntax I'd greatly appreciate it.