0

I have the following structure:

  struct dados{
    int triage;
    int doctors;
    int shift;
    int mq_max;
}data;

and am trying to read in the file config.txt which is composed of:

TRIAGE=5DOCTORS=10SHIFT_LENGTH=5MQ_MAX=20

In the following manner:

int main{
    FILE *fp = fopen("config.txt","r");
    fscanf(fp,"TRIAGE=%dDOCTORS=%dSHIFT_LENGTH=%dMQ_MAX=%d",&data.triage,&data.doctors,&data.shift,&data.mq_max);
 return 0;
}

but all it does is print memory addresses, and obviously I need the values next to the =.

Jason Aller
  • 3,541
  • 28
  • 38
  • 38
NUGA
  • 185
  • 1
  • 2
  • 8

0 Answers0