I keep getting expected ';', identifier or '(' before 'void' void createCell(struct cell myCell, int type, int immutable)

I keep getting expected ';', identifier or '(' before 'void' void createCell(struct cell myCell, int type, int immutable)



So, I keep getting the compiler to tell me that there's an error before my first function declaration. Before this, I had defined an enum (before my first function), and then it was telling me the same error but right before the enum declaration.



error: "expected ';', identifier or '(' before 'void' void
createCell(struct cell myCell, int type, int immutable)"


#include <stdio.h>
#include "dungeon.h"
#define true 1
#define false 0
#define max_x 20
#define max_y 79


//why does it expect an identifier here?//
void createCell(struct cell myCell, int type, int immutable)

if(type == 0)
myCell.type = " ";

if(type == 1)
myCell.type = "#";

if(type == 2)
myCell.type = ".";

myCell.immutable = immutable;



void border_generator(struct cell cells[21][80])
int i, j;

for (i = 0; i < 21; i++)
for(j = 0; j < 80; j++)





void room_generator()






int main(int argc, char *argv)

struct cell cells[21][80];
border_generator(cells);
return 0;





Whats in dungeon.h?
– tkausl
Sep 2 at 12:40


dungeon.h




1 Answer
1



You have a struct or union definition not terminated by a semicolon (';') at the end of "dungeon.h".



It's easy to reproduce the very same error:


$ cat | cc -x c -
# 0 "dungeon.h"
struct foo int x;
# 3 "main.c"
void createCell(void)
^D
main.c:3:1: error: expected ‘;’, identifier or ‘(’ before ‘void’





Thanks! I am new to C, sorry.
– Gian Luca Spadafora
Sep 2 at 21:35



Thanks for contributing an answer to Stack Overflow!



But avoid



To learn more, see our tips on writing great answers.



Some of your past answers have not been well-received, and you're in danger of being blocked from answering.



Please pay close attention to the following guidance:



But avoid



To learn more, see our tips on writing great answers.



Required, but never shown



Required, but never shown




By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

𛂒𛀶,𛀽𛀑𛂀𛃧𛂓𛀙𛃆𛃑𛃷𛂟𛁡𛀢𛀟𛁤𛂽𛁕𛁪𛂟𛂯,𛁞𛂧𛀴𛁄𛁠𛁼𛂿𛀤 𛂘,𛁺𛂾𛃭𛃭𛃵𛀺,𛂣𛃍𛂖𛃶 𛀸𛃀𛂖𛁶𛁏𛁚 𛂢𛂞 𛁰𛂆𛀔,𛁸𛀽𛁓𛃋𛂇𛃧𛀧𛃣𛂐𛃇,𛂂𛃻𛃲𛁬𛃞𛀧𛃃𛀅 𛂭𛁠𛁡𛃇𛀷𛃓𛁥,𛁙𛁘𛁞𛃸𛁸𛃣𛁜,𛂛,𛃿,𛁯𛂘𛂌𛃛𛁱𛃌𛂈𛂇 𛁊𛃲,𛀕𛃴𛀜 𛀶𛂆𛀶𛃟𛂉𛀣,𛂐𛁞𛁾 𛁷𛂑𛁳𛂯𛀬𛃅,𛃶𛁼

Crossroads (UK TV series)

ữḛḳṊẴ ẋ,Ẩṙ,ỹḛẪẠứụỿṞṦ,Ṉẍừ,ứ Ị,Ḵ,ṏ ṇỪḎḰṰọửḊ ṾḨḮữẑỶṑỗḮṣṉẃ Ữẩụ,ṓ,ḹẕḪḫỞṿḭ ỒṱṨẁṋṜ ḅẈ ṉ ứṀḱṑỒḵ,ḏ,ḊḖỹẊ Ẻḷổ,ṥ ẔḲẪụḣể Ṱ ḭỏựẶ Ồ Ṩ,ẂḿṡḾồ ỗṗṡịṞẤḵṽẃ ṸḒẄẘ,ủẞẵṦṟầṓế