You're doing this is an extremely complicated way, way more than necessary.
C has built-in types for integers. You can use int or long long for numbers instead and it would be easier.
Note also that some structs have pointers as members where you allocate memory to, but you never free those. Freeing the struct does not free the memory associated with its pointers.
You also read strings with scanf in the wrong way. See http://cpwiki.sourceforge.net/Buffer_overrun
Also take a look at http://www.cse.scu.edu/~tschwarz/COE...es/Strings.ppt if you can, as it highlights the pitfalls and security issues of C.