one tip i can give you, encapsulate your program within a class. then you can have access to a class-scope data structure all the time. ie:
i cant be bothered typing anymore, but surely you get the idea. basically, use member functions of the instance of 'kohation' whereever you need to access the data of the class.
its a typical approach used in windows programming, because it makes data more accessible, efficient, and organized. i can give you some examples, or better yet, just go to Ken Fitlikes site and look at his class-based code. its all windows stuff, but it gives you some good ideas about classes.
its really good, it got me going. while you're there, you should read up on beginning windows programming. the program you described would benefit from a decent user interface, and frankly, the console is crap for that. good luck.