Congratulate Student error


#1

I’m getting a (use of undeclared identifier ‘student’) error in the printf line below and Xcode will not build it. What am I doing wrong? Thanks!

#include <stdio.h>
void congratulateStudent(char *student, char *course, int numDays);
int main(int argc, const char * argv[])
{

congratulateStudent("Mark", "Cocoa", 5);
congratulateStudent("Bo", "Objective-C", 2);
congratulateStudent("Mike", "Python", 5);
congratulateStudent("Ted", "iOS", 5);

printf("%s has done as much %s Programming as I could fit into %d days.\n", student, course, numDays);

return 0;

}


#2

Your function congratulateStudent is missing its body. It should look like this:

[code]#include <stdio.h>
void congratulateStudent(char *student, char *course, int numDays)
{
printf("%s has done as much %s Programming as I could fit into %d days.\n", student, course, numDays);
}

int main(int argc, const char * argv[])
{
congratulateStudent(“Mark”, “Cocoa”, 5);
congratulateStudent(“Bo”, “Objective-C”, 2);
congratulateStudent(“Mike”, “Python”, 5);
congratulateStudent(“Ted”, “iOS”, 5);
return 0;
}[/code]