1 Attachment(s)
error: illegal hardware instruction
Hello!
I am playing around with C and i tried to create a simple program that stores account numbers and names in a struct array.
To register these parameters i used a int function called registerNewAccount that saves the input from the user. Afterwards i call a struct function (createaccount) to store these parameters. The reason for using a struct function is because i later want to use the function for filehandling (reading and writing to file).
But when i run the program i get the error:
"[1] 41323 illegal hardware instruction"
The error is regarding line 119, which i have highlighted. If i comment that line the program works without any errors.
I have attached a photo of the two functions (registerNewAccount & createaccount)
Could someone take a look and perhaps point to where i have made a mistake?
Here is how my struct looks if thats needed;
Code:
struct Bank
{
char surName[30];
char lastName[30];
char accountNumber[6];
int balance;
};
typedef struct Bank bank;