to your right there is a format section
there is a code tab that will generate
this
[code}{/code] or you can just right that out (using all square brakets [] [] )
when putting code onto this site, copy it directly out of the IDE your using directly into the code tags and it should have proper indentation.
if not, maybe touch it up a bit, the preview button will let you see the final product without actually submitting.
on older posts you can always go back and edit code tags in
EDIT:
thought of some more tips,
be descriptive with your problem, and give an idea where in the code you think the error is occurring,
http://www.cplusplus.com/forum/beginner/1/
refer to that for any other questions