Making a pattern using void()

This is a discussion on Making a pattern using void() within the C++ Programming forums, part of the General Programming Boards category; I am taking intro to c++ so this should be fairly simple for you c++ gurus. Here is an example ...

This is exactly one of the questions I had in my intro programming course right after we learned <iomanip>. That's why I'm asking. Even looking at the format of how the output looks in his example... doesn't it seem strikingly clear as to what simple function would cause that?

hmm, ok well......... so the way I have it is right? All i need to include is a setw()? Also, I DO use a for loop nested statement right. and with the setw(), would this go in one of the for statements or somewhere else?

Ok, thanks for your help, but the main thing that concerns me is creating the actual pattern. You dont have to create it for me obviously, but can you write me a little program which will do basically what I am asking except for the design. just a simple program like this:

enter # of lines: 3
enter character: !
!!!!!
!!!!!
!!!!!

If not, I understand, but where can I get more help with patterns and similar programs like the one just described.

Writing the example you just gave there would put you one line away from writing the pattern in your original post. Let me say that you have some obvious errors in your original code that as 7stud suggested you might want to address before trying to do this assignment. Secondly, if your teacher didn't ask you to use <iomanip>, which I simply assumed because it was an assignment I got when I was at your level, then this program is just as easy to do without it.

I'm new to this whole for loop thing, hell, I'm new to programming in general

Here is the thing... and I don't mean to jump on your back here. Saying you're new doesn't mean much because this isn't a difficult program. Infact, it's an assignment that your teacher gave you, so someone that knows what you're supposed to know is saying it's not a difficult program. So by us telling you anymore really says little for the amount that you've learned in class.

Also, don't say your teacher didn't go over loops well, because everyone uses that excuse and it's just flat out not true.

This program gives me the following output:
enter lines: 5
enter character: *
____****
___****
__****
_****
(^^ignore the _'s again^^)
Can someone point me in the direction of where to look at to see whats causing this problem. I believe I'm correct, but should the for statements go the other way around? Are the increments I'm doing right? Please help as much as you are able to