C Programming Error Array Type Has Incomplete Element Type
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About error array type has incomplete element type struct Us Learn more about Stack Overflow the company Business Learn more about hiring
Array Type Has Incomplete Element Type Extern Struct
developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the array has incomplete element type 'char ' Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Error: Array type has incomplete element array type has incomplete element type char type and binary operand error up vote 0 down vote favorite I am trying to make a multi-program database in C. Here is the code: #include
Type Of Formal Parameter 1 Is Incomplete C
= fopen("database.txt","w"); if(fp == NULL) { printf("File does not exist!"); return 0; } else { while(x<=1) { printf("Enter Employee name no.%d: ",(x+1)); scanf("%s",name[x]); fprintf(fp, "Employee Name: %s\n",name); printf("Enter Employee ID: "); scanf("%s",id[x]); fprintf(fp, "Employee ID: %s\n",id); printf("Enter Employee Grade Level (A-E): "); scanf("%s",grade[x]); fprintf(fp, "Employee Grade Level: %s\n",grade); printf("Enter Employee's Basic Salary: "); scanf("%d",&sal[x]); fprintf(fp, "Employee's Basic Salary: %d\n\n\n",sal); printf("Employee's bonus: %d\n",bonus(grade[x],sal[x])); printf("Employee's allowance: %d\n",allowance(grade[x], sal[x])); printf("\n"); } } fclose(fp); } else { return 0; } return 0; } function.c : #include
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more incomplete array about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges array has incomplete element type 'char ' c++ Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each
Array Has Incomplete Element Type 'int []' C++
other. Join them; it only takes a minute: Sign up C Compile Error: array type has incomplete element type up vote 3 down vote favorite #include
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting http://stackoverflow.com/questions/18937822/array-type-has-incomplete-element-type ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join http://cboard.cprogramming.com/c-programming/137733-array-type-has-incomplete-element-type.html the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up “array type has incomplete element type” up vote 0 down vote favorite I am new to C programming, and have the following code. I am facing following error. typedef struct Vertex Vertex; typedef struct Edge Edge; struct Vertex has incomplete { bool known; char id[25]; Edge edges[20]; int distance; }; struct Edge { Vertex target; int weight; }; typedef struct { Vertex Nodes[20]; int pass; int infinity; } Graph; The error it gives is: array type has incomplete element type Can someone please help me understand what is the problem? c struct circular-dependency share|improve this question edited Sep 21 '13 at 22:27 Jens Gustedt 55.4k257124 asked Sep 21 '13 at 21:27 AnilJ 4761517 -1 for posting a screenshot of text. has incomplete element (Should have been a Youtube video showing your code line-by-line backed by Abba.) –Kerrek SB Sep 21 '13 at 21:32 @KerrekSB Problem solved –totymedli Sep 21 '13 at 21:33 2 Your setup makes no sense. It's essentially the same as struct Box { struct Box x; };. –Kerrek SB Sep 21 '13 at 21:35 1 @KerrekSB Try to give some good feedback, Vertex target; is probably mean to be a pointer. –this Sep 21 '13 at 21:37 add a comment| 5 Answers 5 active oldest votes up vote 1 down vote typedef struct Vertex Vertex; typedef struct Edge Vertex; this is probably generating some name conflict just change the name of one of them. share|improve this answer edited Sep 21 '13 at 21:49 answered Sep 21 '13 at 21:40 Farouk Jouti 1,408414 No, that's not the answer. There is no name conflict. –Kerrek SB Sep 21 '13 at 21:45 There was just a typo in the edit. I have corrected it, now, –Jens Gustedt Sep 21 '13 at 22:29 add a comment| up vote 0 down vote The only way this will be possible, is using a mixture of pointers and addressing how you implement your Vertex and Edge structures: /*your typedefs didn't make sense to me as it was conflicting. So, I edited it accordingly*/ //typedef struct Vertex Vertex; //typedef struct Edge Vertex; struct Vertex; struct Edge; typedef struct Vertex { bool known; char id[25];
Programming Boards C Programming array type has incomplete element type Getting started with C or C++ | C Tutorial | C++ Tutorial | C and C++ FAQ | Get a compiler | Fixes for common problems Thread: array type has incomplete element type Thread Tools Show Printable Version Email this Page… Subscribe to this Thread… Display Linear Mode Switch to Hybrid Mode Switch to Threaded Mode 05-06-2011 #1 philgrek View Profile View Forum Posts Registered User Join Date Feb 2011 Posts 42 array type has incomplete element type Im down to a deadline and need to solve the problems with this code. When compiling its giving me the errors: [12:22:05][peg002@lnxAcadShell01][/home/peg002/LAB4]+ make cc -c -o lib/SelectionSort.o lib/SelectionSort.c lib/SelectionSort.c:6: error: array type has incomplete element type lib/SelectionSort.c:6: warning: âstruct employeeâ declared inside parameter list lib/SelectionSort.c:6: warning: its scope is only this definition or declaration, which is probably not what you want lib/SelectionSort.c: In function âSelectionSortâ: lib/SelectionSort.c:9: error: array type has incomplete element type make: *** [lib/SelectionSort.o] Error 1 Code: #include