This is my code (not yet finished), written in C.
#include <stdio.h>
#include <string.h>
//defining struct for customer management
struct customers {
char regNumber; //registration number of the car
char carBrand; //brand og the car
char rimType; //rim type, aluminum or steel
char tireType; //tire type, summer or winter
int queuePlace; //place in queue
int waitTime; //time till customer is treated
};
//functions used
void standardStartQueue (char regNumber[12], char carBrand[12], char rimType[9], char tireType[4]);
int main ()
{
//defining vairables
char regNumber[12], carBrand[12], rimType[9], tireType[4];
//function that imports standard start queue
standardStartQueue (®Number[12], &carBrand[12], &rimType[9], &tireType[4]);
printf("%s %s %s %s", regNumber, carBrand, rimType, tireType);
}
//function that imports standard start queue
void standardStartQueue (char regNumber[12], char carBrand[12], char rimType[9], char tireType[4])
{
FILE *fp;
fp = fopen("queue.txt", "r");
fscanf(fp, "%s%s%s%s", regNumber, carBrand, rimType, tireType);
}
When i run the compiler i get the error code:
*** stack smashi´ng detected **: terminated
Can someone help me solve this?
Thank you 3000!