Trying to make a grid for fun, what am I doing wrong?
Code:
#include <iostream> ----------------- | | | | | ----------------- | | | | | ----------------- | | | | | ----------------- | | | | | ----------------- I want to do it using while and for loops too. Help is much appreciated!! Here are errors I'm getting Code:
10: error: expected primary-expression before âwhileâ For some reason its not coming out as I want it to look on here, its; 17 "-" 5 "|" 9 rows 17 columns |
You really need to work on the formatting/indenting, that code is almost unreadable. It's also full of unbalanced parenthesis...at least I think, I can't tell because of the formatting. You have an else if inside a while, etc.
|
sorry here
Code:
#include <iostream> |
What about this? I completely rewrote the code, I couldn't really figure out what you were trying to do in the example.
Code:
#include <iostream> |
I like the idea of the for loop, why does it seem easier with the for instead of the while??
|
ok when i did yours I got,
----------------| | | | ----------------| | | | ----------------| | | | ----------------| | | | ---------------- I there should be an "endl" after each one where should I put them? |
Did you miss the "cout << endl" line in the code? It looks fine on mine:
Code:
$ g++ test.c |
All times are GMT -5. The time now is 06:01 PM. |