Hi i've just started to use constructors and I'm having some problems with the following code with data not saving(saving to the correct place)
please Help :(
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
typedef struct details // struct for all data
{
char name[50][50];
char card[50][16];
long sort[50], acco[50];
int pin[50];
} DETAILS;
void info();
int main()
{
DETAILS dt;
strcpy(dt.name[0],"SAM BERWICK");
dt.sort[0] = 102030;
dt.acco[0] = 12345678;
strcpy(dt.card[0],"1234567812345678");
dt.pin[0] = 1234;
strcpy(dt.name[1],"DAN BERWICK");
dt.sort[1] = 302010;
dt.acco[1] = 87654321;
strcpy(dt.card[1],"8765432187654321");
dt.pin[1] = 4321;
info();
}
void info()
{
DETAILS dt;
printf("Details n1\n");
printf("%d",dt.sort[0]);
system("pause");
}