1 Bill 25 MD
1 Fred 85 CA
1 Mark 60 VT
1 Jane 45 VT
1 Hank 30 WI
0
prog.c: In function 'main':
prog.c:34:25: warning: assignment makes integer from pointer without a cast [-Wint-conversion]
memberName[count] = name; // warning: assignment makes integer from pointer without a cast
^
prog.c:38:26: warning: assignment makes integer from pointer without a cast [-Wint-conversion]
memberState[count] = state; // warning: assignment makes integer from pointer without a cast
^
prog.c:39:14: warning: format '%s' expects argument of type 'char *', but argument 2 has type 'int' [-Wformat=]
printf("%s\t", memberName[count]); // warning: format '%s' expects argument of type 'char *', but argument 2 has type 'int'
^
prog.c:41:14: warning: format '%s' expects argument of type 'char *', but argument 2 has type 'int' [-Wformat=]
printf("%s\n", memberState[count]); // warning: format '%s' expects argument of type 'char *', but argument 2 has type 'int'
^
In file included from /usr/include/string.h:635:0,
from prog.c:2:
prog.c:43:17: warning: passing argument 1 of '__builtin_strlen' makes pointer from integer without a cast [-Wint-conversion]
if(strcmp(memberState[count],"VT")!=0) // comparison between pointer and integer
^
prog.c:43:17: note: expected 'const char *' but argument is of type 'char'
prog.c:43:17: warning: passing argument 1 of '__builtin_strcmp' makes pointer from integer without a cast [-Wint-conversion]
if(strcmp(memberState[count],"VT")!=0) // comparison between pointer and integer
^
prog.c:43:17: note: expected 'const char *' but argument is of type 'char'
prog.c:43:17: warning: passing argument 1 of '__builtin_strlen' makes pointer from integer without a cast [-Wint-conversion]
if(strcmp(memberState[count],"VT")!=0) // comparison between pointer and integer
^
prog.c:43:17: note: expected 'const char *' but argument is of type 'char'
prog.c:43:17: warning: passing argument 1 of '__builtin_strcmp' makes pointer from integer without a cast [-Wint-conversion]
if(strcmp(memberState[count],"VT")!=0) // comparison between pointer and integer
^
prog.c:43:17: note: expected 'const char *' but argument is of type 'char'
prog.c:43:17: warning: passing argument 1 of '__builtin_strcmp' makes pointer from integer without a cast [-Wint-conversion]
if(strcmp(memberState[count],"VT")!=0) // comparison between pointer and integer
^
prog.c:43:17: note: expected 'const char *' but argument is of type 'char'
prog.c:43:17: warning: passing argument 1 of '__builtin_strcmp' makes pointer from integer without a cast [-Wint-conversion]
if(strcmp(memberState[count],"VT")!=0) // comparison between pointer and integer
^
prog.c:43:17: note: expected 'const char *' but argument is of type 'char'
prog.c:23:7: warning: unused variable 'i' [-Wunused-variable]
int i,count = 1; // Tracks total number of family members entered
^
prog.c:21:9: warning: unused variable 'vtAverageAge' [-Wunused-variable]
float vtAverageAge = 0.0; // Stores average age of family members in Vermont
^
prog.c:20:9: warning: unused variable 'usAverageAge' [-Wunused-variable]
float usAverageAge = 0.0; // Stores average age of all family members
^
prog.c: At top level:
prog.c:57:3: warning: data definition has no type or storage class
usAverageAge = averageFunction(usTotalAge, count);
^
prog.c:57:3: warning: type defaults to 'int' in declaration of 'usAverageAge' [-Wimplicit-int]
prog.c:57:34: error: 'usTotalAge' undeclared here (not in a function)
usAverageAge = averageFunction(usTotalAge, count);
^
prog.c:57:46: error: 'count' undeclared here (not in a function)
usAverageAge = averageFunction(usTotalAge, count);
^
prog.c:58:10: error: expected declaration specifiers or '...' before string constant
printf("Average age of all family members:\t%f\n", usAverageAge);
^
prog.c:58:54: error: expected declaration specifiers or '...' before 'usAverageAge'
printf("Average age of all family members:\t%f\n", usAverageAge);
^
prog.c:59:3: warning: data definition has no type or storage class
vtAverageAge = averageFunction(vtTotalAge, vtCount);
^
prog.c:59:3: warning: type defaults to 'int' in declaration of 'vtAverageAge' [-Wimplicit-int]
prog.c:59:34: error: 'vtTotalAge' undeclared here (not in a function)
vtAverageAge = averageFunction(vtTotalAge, vtCount);
^
prog.c:59:46: error: 'vtCount' undeclared here (not in a function)
vtAverageAge = averageFunction(vtTotalAge, vtCount);
^
prog.c:60:10: error: expected declaration specifiers or '...' before string constant
printf("Average age of family members in VT:\t%f\n", vtAverageAge);
^
prog.c:60:56: error: expected declaration specifiers or '...' before 'vtAverageAge'
printf("Average age of family members in VT:\t%f\n", vtAverageAge);
^
prog.c:61:10: error: expected declaration specifiers or '...' before string constant
printf("Names of family members in VT:\n");
^
prog.c:62:3: warning: data definition has no type or storage class
count = 1;
^
prog.c:62:3: warning: type defaults to 'int' in declaration of 'count' [-Wimplicit-int]
prog.c:63:3: error: expected identifier or '(' before 'for'
for(i=0; i<count; i++)
^
prog.c:63:13: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
for(i=0; i<count; i++)
^
prog.c:63:22: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
for(i=0; i<count; i++)
^
prog.c:71:3: error: expected identifier or '(' before 'return'
return 0;
^
prog.c:72:1: error: expected identifier or '(' before '}' token
}
^