Note that there are some explanatory texts on larger screens.

plurals
  1. POWhy do i get the error error: expected expression before ‘char’?
    primarykey
    data
    text
    <pre><code>#include &lt;stdio.h&gt; #include &lt;stdlib.h&gt; #include &lt;time.h&gt; </code></pre> <p>This is my function that prints an array of 10 by 10 '.' </p> <pre><code>void drawMap(char map[10][10]){ int i, j; printf("Now drawing map\n"); for(i = 0; i &lt; 10; i++){ for(j = 0; j &lt; 10; j++){ map[i][j] = '.'; printf("%c ", map[i][j]); } printf("\n"); } } </code></pre> <p>The function that uses the above function. I get one error here.</p> <pre><code>void findThecookie(){ drawMap(char map[10][10], int i, int j); } </code></pre> <p>This is my main function.</p> <pre><code>int main() { int gamenumber; int randomNumber; int guessednum; printf("Hello and welcome to my babysitting game.\n"); printf("Please select your option. Your choices are:\n"); printf("1) Number guessing game\n" "2) Rock-Paper-Scissors\n" "3) Area of a Random Rectangle\n" "4) Find the Cookie\n" "5) Quit\n"); scanf("%d", &amp;gamenumber); if(gamenumber == 1){ numberGuessing(); } if(gamenumber == 2){ rockPaperscissors(); } if(gamenumber == 3){ randomRectangle(); } </code></pre> <p>Another error here</p> <pre><code>if(gamenumber == 4){ findThecookie(char map[10][10], int i, int j); } if(gamenumber == 5){ printf("Exiting the program\n"); } return 0; </code></pre> <p>Everytime i try to compile i get the errors</p> <pre><code>project2.c: In function ‘findThecookie’: project2.c:22:9: error: expected expression before ‘char’ project2.c: In function ‘main’: project2.c:171:17: error: expected expression before ‘char’ </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload