Hello anonymous9999,
Welcome to the forum.
You can do a search here on both parts of your subject which would give you a good start.
If you get stuck post what code you have to receive help.
Do not forget to include the instructions fo the program, any sample data you are using and any output to show what your program is doing.
Just in case I will say this now:
PLEASE ALWAYS USE CODE TAGS (the <> formatting button), to the right of this box, when posting code.
It makes it easier to read your code and also easier to respond to your post.
http://www.cplusplus.com/articles/jEywvCM9/
http://www.cplusplus.com/articles/z13hAqkS/
Hint: You can edit your post, highlight your code and press the <> formatting button.
You can use the preview button at the bottom to see how it looks.
I found the second link to be the most help.
Hope that helps,
Andy