I want to scan these values to an array. I created a struct and the array is of that type. My problem is that, when i compile, all the ints work fine, but when it comes to the strings it doesn't let me insert any values and jumps to the next instruction of my code. What am I doing wrong?
printf("\nInsert id: ");
scanf("%i", &vDisp[MAXDISP].idComp);
printf("\nInsert serial number: ");
scanf("%i", &vDisp[MAXDISP].serial);
printf("\nInsert production year: ");
scanf("%i", &vDisp[MAXDISP].year);
printf("\nInsert brand: ");
scanf("%[^\n]%*c", &vDisp[MAXDISP].brand);
printf("\nInsert type: ");
scanf("%[^\n]%*c", &vDisp[MAXDISP].type);
printf("\nInsert model: ");
scanf("%[^\n]%*c", &vDisp[MAXDISP].model);
printf("\nInsert OS: ");
scanf("%[^\n]%*c", &vDisp[MAXDISP].system);
Thanks in advance!