I'm trying to run my program, but it keeps giving an error.
I have 3 files and will include the code from one of the 3 functions that are not working.
File: contacts.h
struct Name{
char firstName[31];
char middleInitial[7];
char lastName[36];
};
struct Contact{
struct Name name;
};
// function prototype:
void getName(struct Name *);
File: contacts.c
#include <stdio.h>
#include “contacts.h”
void getName(struct Name *name)
{
printf(“Please enter the contact’s first name: “);
scanf(“%30[&\n]”, name->firstName);
}
File:a1ms4.c
#include <stdio.h>
#include “contacts.h”
int main(void)
{
struct Contact contact = { {0} };
getName(&contect.name);
printf(“Contact first name: %s\n”, contact.name.firstName);
return 0;
}
Any idea why I'm getting this error:
a1ms4.c:(.text+0x53): undefined reference to `getName'