I am having errors in a block of my code for a program that stores/calculates calories burned per person based on input.
Here's the block of code:
char activitiesAllowed[(argc+1)/2][BUFSIZ];
int caloriesPer[(argc+1)/2];
int i;
for (i=1; i<argc; i++) { //loops through input arguments putting one in activity, then one in caloriesPer
strcpy(activitiesAllowed[i],argv[i]); //puts activity in array
strcpy(caloriesPer[i],atoi(argv[++i])); //converts argc to int and puts in caloriesPer
}
The 6 errors occur on line 6 and the errors are:
Passing argument 1 of '__builtin_object_size' makes pointer from integer without a cast Passing argument 1 of '__builtin_object_size' makes pointer from integer without a cast Passing argument 1 of '__builtin__strcpy_chk' makes pointer from integer without a cast Passing argument 2 of '__builtin__strcpy_chk' makes pointer from integer without a cast Passing argument 1 of '__inline_strcpy_chk' makes pointer from integer without a cast Passing argument 2 of '__inline_strcpy_chk' makes pointer from integer without a cast
Any help is much appreciated.
Thanks,
Michael

New Topic/Question
Reply




MultiQuote




|