Home > has incomplete > c error parameter has incomplete type

C Error Parameter Has Incomplete 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 Us Learn more about Stack Overflow the company Business Learn more c error field has incomplete type about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges error field has incomplete type struct Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each error aggregate has incomplete type other. Join them; it only takes a minute: Sign up How to resolve “parameter has incomplete type” error? up vote -1 down vote favorite I'm a newbie and I need help with debugging my code. When I compile it

Error Aggregate Has Incomplete Type And Cannot Be Defined

'type of formal parameter 1 is incomplete' and type of formal parameter 2 is incomplete' error appears in printf("Age is %d years.\n", calc_age(birth, current)); while 'parameter 1 ('birth') has incomplete type' and ' parameter 2 ('current') has incomplete type' errors appear in int calc_age (struct date birth, struct date current) { Help is appreciated, thanks! #include int calc_age (struct date birth, struct date current); int main(void) { struct date { int month[1]; int day[1]; int year[1]; array type has incomplete element type error c }; struct date birth, current; char c; printf("Input the birthdate (MM/DD/YY): "); scanf("%d %c %d %c %d", birth.month, &c, birth.day, &c, birth.year); printf("Input date to calculate (MM/DD/YY): "); scanf("%d %c %d %c %d", current.month, &c, current.day, &c, current.year); printf("Age is %d years.\n", calc_age(birth, current)); return 0; } int calc_age (struct date birth, struct date current) { int age; if (birth.month[0] < current.month[0]) { age = (current.year[0] - birth.year[0]); } else if (birth.month[0] > current.month[0]) { age = (current.year[0] - birth.year[0] - 1); } else { if (birth.day[0] <= current.day[0]) { age = (current.year[0] - birth.year[0]); } else { age = (current.year[0] - birth.year[0] - 1); } } return age; } c arrays function struct share|improve this question edited Mar 31 '15 at 15:31 Sourav Ghosh 70.5k1173127 asked Mar 31 '15 at 14:55 eternum 613 1 What is wrong?? –jsn Mar 31 '15 at 14:56 scanf() returns the number of items successfully read : test the return value of scanf() ! If it does not print things before the end of the program...Remember that stdout is buffered. Add fflush(stdout); after printf("..."); and things wil be displayed at the right time. You may want to add newline as things are printed : add \n at the end of the string printed. Like printf("...\n",...); –francis Mar 31 '15 at 15:01 2 define of struct date move to before prototype of

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 type of formal parameter 1 is incomplete Business Learn more about hiring developers or posting ads with us Stack Overflow Questions

Variable Has Incomplete Type Struct

Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers,

How To Pass Structure To A Function In C

just like you, helping each other. Join them; it only takes a minute: Sign up parameter has incomplete type up vote 0 down vote favorite I get the warning "parameter has incomplete type" in the last http://stackoverflow.com/questions/29371704/how-to-resolve-parameter-has-incomplete-type-error line. But I have no idea why. struct clockClass { uint32_t (*getClock) (void); bool (*setCorrectionFactor)(uint32_t newCorrectionFactor); uint32_t (*getCorrectionFactor) (void); }; /* Type definition for ::virtualClock */ typedef struct clockClock ClockClass; /* VC Synchronization Class */ struct vcSync_sRio { bool (*vcSync)(ClockClass me); /*Warning LINE*/ }; c struct typedef share|improve this question edited Feb 15 '13 at 10:34 LihO 26.8k44392 asked Feb 15 '13 at 10:21 user1829804 4415 3 struct clockClass { but typedef struct http://stackoverflow.com/questions/14892568/parameter-has-incomplete-type clockClock ClockClass; I see the difference, do you? –aragaer Feb 15 '13 at 10:23 Which compiler are you using? GCC, Visual Studio? Anything else? Any specific warning number? –bash.d Feb 15 '13 at 10:23 @aragaer Nice one! Didn't get it until you pointed it out :) –bash.d Feb 15 '13 at 10:24 @aragaer Oh Fu... –user1829804 Feb 15 '13 at 10:26 add a comment| 2 Answers 2 active oldest votes up vote 1 down vote It seems it's just a typo: you have defined struct clockClass but your typedef defines an alias for struct clockClock. Change your typedef to: typedef struct clockClass ClockClass; share|improve this answer answered Feb 15 '13 at 10:24 LihO 26.8k44392 add a comment| up vote 0 down vote Change the line to: bool (*vcSync)(struct ClockClass me); or change the other line to: typedef struct ClockClass ClockClass; share|improve this answer answered Feb 15 '13 at 10:22 Alexey Frunze 45k83787 add a comment| Your Answer draft saved draft discarded Sign up or log in Sign up using Google Sign up using Facebook Sign up using Email and Password Post as a guest Name Email Post as a guest Name Email discard By posting your answer, you agree to the privacy policy and terms of service. Not the answer you're looking

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 ads with http://stackoverflow.com/questions/13425879/parameter-has-incomplete-type-in-c us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join 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 parameter has incomplete type in C up vote 1 down vote favorite 2 I'm writing some code, when I'm trying to test my code till now, I get an error. Here is my code: #include enum { add = 0, addu, has incomplete sub, subu } mips_opcode; typedef enum mips_opcode mips_opcode_t; typedef unsigned char byte; // 8-bit int struct mips { char *name; byte opcode; }; typedef struct mips mips_t; void init (mips_t *out, char *name_tmp, mips_opcode_t opcode_tmp) { out->name = name_tmp; out->opcode = (byte)opcode_tmp; } int main (void) { pritnf("no error i assume\n"); return 0; } and the error in the commmand-line is: main.c:14:55: error: parameter 3 ('opcode_tmp') has incomplete type Can't I use enums as parameter or what am I doing wrong here? c enums has incomplete type compiler-errors incomplete-type share|improve this question edited Jan 29 '13 at 20:52 starblue 38.1k1063117 asked Nov 16 '12 at 23:24 hakuna matata 1,04963054 1 I'm surprised it got that far without choking -- it should be giving you an error on the line typedef enum mips_opcode mips_opcode_t because mips_opcode is a variable, not a type. –Adam Rosenfield Nov 16 '12 at 23:27 3 I thought pritnf("no error") was the actual joke here... –Kerrek SB Nov 16 '12 at 23:29 It appears you are confusing C and c++. In C a struct definition is not a tyepdef. –wildplasser Nov 16 '12 at 23:29 1 @wildplasser: In C++, a struct definition is also not a typedef. –Kerrek SB Nov 16 '12 at 23:31 To expand on Kerrek's comment, see this Dr. Dobb's article. In almost all instances, struct mips is equivalent to mips in C++, except when you have name hiding (which is usually bad practice). –Adam Rosenfield Nov 16 '12 at 23:36 | show 1 more comment 2 Answers 2 active oldest votes up vote 3 down vote accepted It needs to be like this: enum mips_opcode { add = 0, addu, sub, subu }; // type name is "enum mips_opcode" typedef enum mips_opcode mips_opcode_t; // type alias Or even: typedef enum { add = 0, addu, sub, subu } mips_opcode_t; // alias of anon. type Don't confuse type names and variables! (By the way, Posix reserves _t suffixes for types, I believe...) share|improve

 

Related content

array type has incomplete element type error c

Array Type Has Incomplete Element Type Error C table id toc tbody tr td div id toctitle Contents div ul li a href Error Array Type Has Incomplete Element Type Struct a li li a href Type Of Formal Parameter Is Incomplete C a li li a href Array Has Incomplete Element Type int C a li ul td tr tbody table p here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and relatedl policies of this site About Us Learn more about Stack array has incomplete

array type has incomplete element type error

Array Type Has Incomplete Element Type Error table id toc tbody tr td div id toctitle Contents div ul li a href Error Array Type Has Incomplete Element Type Gcc a li li a href Error Label At End Of Compound Statement a li li a href Error Array Type Has Incomplete Element Type Mud a li ul td tr tbody table p 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 relatedl Learn more about Stack Overflow the company

c programming error array type has incomplete element type

C Programming Error Array Type Has Incomplete Element Type table id toc tbody tr td div id toctitle Contents div ul li a href Array Type Has Incomplete Element Type Extern Struct a li li a href Type Of Formal Parameter Is Incomplete C a li li a href Array Has Incomplete Element Type int C a li ul td tr tbody table p here for a quick overview of the site Help Center Detailed answers to any questions you might have relatedl Meta Discuss the workings and policies of this site About error array type has incomplete element type

compile error has incomplete type

Compile Error Has Incomplete Type table id toc tbody tr td div id toctitle Contents div ul li a href Error Field Has Incomplete Type a li li a href Error Field Has Incomplete Type Struct a li li a href Error Aggregate Has Incomplete Type a li ul td tr tbody table p here for a quick overview of the relatedl site Help Center Detailed answers to any questions c error has incomplete type you might have Meta Discuss the workings and policies of p h id Error Field Has Incomplete Type p this site About Us Learn more

error 1 array type has incomplete element type

Error Array Type Has Incomplete Element Type table id toc tbody tr td div id toctitle Contents div ul li a href Error Array Type Has Incomplete Element Type In C a li li a href Array Type Has Incomplete Element Type Struct a li li a href Array Has Incomplete Element Type Char a li li a href Array Type Has Incomplete Element Type Char a li ul td tr tbody table p here for a quick overview of the site Help Center Detailed answers to any questions relatedl you might have Meta Discuss the workings and policies error

error array has incomplete element type

Error Array Has Incomplete Element Type table id toc tbody tr td div id toctitle Contents div ul li a href Error Array Type Has Incomplete Element Type Gcc a li li a href Error Label At End Of Compound Statement a li li a href Error Expected Specifier Qualifier List Before a li ul td tr tbody table p here for relatedl a quick overview of the site Help array has incomplete element type char Center Detailed answers to any questions you might have Meta error array type has incomplete element type in c Discuss the workings and policies

error array type has incomplete element type struct

Error Array Type Has Incomplete Element Type Struct table id toc tbody tr td div id toctitle Contents div ul li a href Array Type Has Incomplete Element Type C a li li a href Array Has Incomplete Element Type char a li li a href Incomplete Array a li ul td tr tbody table p here for a quick overview of the site Help Center Detailed answers to any questions relatedl you might have Meta Discuss the workings and policies array type has incomplete element type extern struct of this site About Us Learn more about Stack Overflow the

error array type has incomplete element type gcc

Error Array Type Has Incomplete Element Type Gcc table id toc tbody tr td div id toctitle Contents div ul li a href Error Array Type Has Incomplete Element Type In C a li li a href Array Has Incomplete Element Type char a li li a href Type Of Formal Parameter Is Incomplete C a li li a href Array Has Incomplete Element Type int C a li ul td tr tbody table p here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and relatedl policies

error array type has incomplete element type c

Error Array Type Has Incomplete Element Type C table id toc tbody tr td div id toctitle Contents div ul li a href Array Has Incomplete Element Type char a li li a href Array Type Has Incomplete Element Type Char a li li a href Array Has Incomplete Element Type char C a li ul td tr tbody table p here for a quick overview of the site Help Center Detailed answers to any relatedl questions you might have Meta Discuss the workings and error array type has incomplete element type struct policies of this site About Us Learn

error array type has incomplete element type

Error Array Type Has Incomplete Element Type table id toc tbody tr td div id toctitle Contents div ul li a href Error Array Type Has Incomplete Element Type In C a li li a href Error Label At End Of Compound Statement a li li a href Array Type Has Incomplete Element Type Extern Struct a li ul td tr tbody table p here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings relatedl and policies of this site About Us Learn more about Stack error array

error field has incomplete type enum

Error Field Has Incomplete Type Enum table id toc tbody tr td div id toctitle Contents div ul li a href C Error Field Has Incomplete Type a li li a href Error Field St atim Has Incomplete Type a li li a href Error Field Info Has Incomplete Type a li ul td tr tbody table p 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 relatedl About Us Learn more about Stack Overflow the company Business Learn error field has

error field has incomplete type qt

Error Field Has Incomplete Type Qt table id toc tbody tr td div id toctitle Contents div ul li a href Error Field St atim Has Incomplete Type a li li a href Error Field Info Has Incomplete Type a li li a href Field Has Incomplete Type Class a li ul td tr tbody table p here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta relatedl Discuss the workings and policies of this site About Us error field has incomplete type struct Learn more about Stack Overflow the company

error field has incomplete type string

Error Field Has Incomplete Type String table id toc tbody tr td div id toctitle Contents div ul li a href Error Field Has Incomplete Type Struct a li li a href Error Field Info Has Incomplete Type a li li a href Field Has Incomplete Type Array a li li a href Field Has Incomplete Type Template a li ul td tr tbody table p Sign in Pricing Blog Support Search GitHub option form This repository Watch Star Fork Valloric YouCompleteMe Code Issues Pull requests Projects relatedl Wiki Pulse Graphs New issue variable has incomplete p h id Error

error field has incomplete type class

Error Field Has Incomplete Type Class table id toc tbody tr td div id toctitle Contents div ul li a href Error Field St atim Has Incomplete Type a li li a href Field Has Incomplete Type Template a li li a href Field Has Incomplete Type Struct C a li ul td tr tbody table p here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss relatedl the workings and policies of this site About Us Learn error field has incomplete type struct more about Stack Overflow the company

error field has incomplete type gcc

Error Field Has Incomplete Type Gcc table id toc tbody tr td div id toctitle Contents div ul li a href Error Dereferencing Pointer To Incomplete Type Gcc a li li a href Error Field Has Incomplete Type Struct a li li a href C Error Field Has Incomplete Type a li ul td tr tbody table p here for a relatedl quick overview of the site Help Center error array type has incomplete element type gcc Detailed answers to any questions you might have Meta Discuss p h id Error Dereferencing Pointer To Incomplete Type Gcc p the workings

error field has incomplete type c

Error Field Has Incomplete Type C table id toc tbody tr td div id toctitle Contents div ul li a href Error Field St atim Has Incomplete Type a li li a href Field Has Incomplete Type Template a li li a href Field Has Incomplete Type Struct Sockaddr a li ul td tr tbody table p here for a quick overview of the relatedl site Help Center Detailed answers to any questions error field has incomplete type struct you might have Meta Discuss the workings and policies of this p h id Error Field St atim Has Incomplete Type

error has incomplete type

Error Has Incomplete Type table id toc tbody tr td div id toctitle Contents div ul li a href Error Field Has Incomplete Type Struct a li li a href Error Aggregate Has Incomplete Type And Cannot Be Defined a li li a href Stringstream Has Incomplete Type a li ul td tr tbody table p here for a quick overview of the site Help Center Detailed answers to any questions you relatedl might have Meta Discuss the workings and policies of error has incomplete type c this site About Us Learn more about Stack Overflow the company Business p

kernel error array type has incomplete element type

Kernel Error Array Type Has Incomplete Element Type table id toc tbody tr td div id toctitle Contents div ul li a href Error Array Type Has Incomplete Element Type Struct a li li a href Array Type Has Incomplete Element Type Char a li li a href Array Type Has Incomplete Element Type Int a li ul td tr tbody table p 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 relatedl site About Us Learn more about Stack Overflow the company