#include <stdio.h>
#include <stdlib.h>
#include <time.h>
これは、10 x 10 '.' の配列を出力する関数です。
void drawMap(char map[10][10]){
int i, j;
printf("Now drawing map\n");
for(i = 0; i < 10; i++){
for(j = 0; j < 10; j++){
map[i][j] = '.';
printf("%c ", map[i][j]);
}
printf("\n");
}
}
上記の機能を利用した機能。ここで 1 つのエラーが発生します。
void findThecookie(){
drawMap(char map[10][10], int i, int j);
}
これが私の主な機能です。
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", &gamenumber);
if(gamenumber == 1){
numberGuessing();
}
if(gamenumber == 2){
rockPaperscissors();
}
if(gamenumber == 3){
randomRectangle();
}
ここで別のエラー
if(gamenumber == 4){
findThecookie(char map[10][10], int i, int j);
}
if(gamenumber == 5){
printf("Exiting the program\n");
}
return 0;
コンパイルしようとするたびにエラーが発生します
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’