You're inputting the information backwards, it would be best to use strcpy() for copying the names in, and just fgets() with an atoi() or atof() function to convert. Then just assign those values returned to the structure members. Think strcpy() for strings and fgets() (atoi/atof) for integer/float values.

05-30-2003

Cat

As to your first error: How many bytes is regNumber? I would wager it's only 4 bytes -- but "1234" takes up *five* bytes because it has to be null terminated. If it has to be a pure number you're better off using an integer and atoi() to get the number.

Show us how the struct itself is defined.

05-30-2003

Cooper

thanks for taking a look at this guys...
I tried the strcpy() but still get the same result.
here is the struct :