I recently started CS50 and I am currently in the process of completing Problem Set 1 - Mario (The less comfortable one). I am really confused by the hash pyramid problem, so I've been trying different things. I decided to try the code given to print a square in the hint, so I put it into the lab.
1 #include <stdio.h>
2 #include <cs50.h>
3
4 // Variables
5 int height;
6 int hash;
7 int space;
8 int i;
9 int n;
10
11 int main(void);
12 {
13 // Asks user for integer between 1 and 8, inclusive, and prints pyramid based on user input
14 int i = get_int("Height: \n");
15 int n;
16 do
17 {
18 for (int height = 0; i < n; height++)
19 {
20 for (int space = 0; space < n; space++)
21 {
22 printf("#");
23 }
24 printf("\n");
25 }
26 }
27 while (i > 8 || i <= 0);
28 }
When I try to compile this, I get only one error that says 'Expected identifier or '('' (in line 12, character 1). I am absolutely clueless on what this means, can anyone help me with this please? I am going to try and write my own code for the pyramid, but I wanted to try the square first to get a basic idea. I might be back for help with the pyramid though :p
Thanks!