Question: Can someone help me with getaddress function Here is some specific instruction: Write your getaddress function to obtain the address information the address field may

Can someone help me with getaddress function

Here is some specific instruction:

Write your getaddress function to obtain the address information

  • the address field may have multiple lines of address
  • It must be stored as one character array
  • You CANNOT ask the user how many lines of address they are going to type
  • You CANNOT ask if the user wants to fill another line while he/she is typing
  • You CANNOT ask if the user wants to type one more line during typing.
  • Prototype for the function is
    void getaddress (char [ ], int);

Here is my code: (The bolded part is the one that I want to be fixed. I just included other parts so it could somehow make sense)

void getaddress (char [ ], int);

void menu()

{ printf(" Greetings, what do you want to do with the database? "); printf("------------------------------------------------------------------------ "); printf(" 1. add "); printf(" 2. printall "); printf(" 3. find "); printf(" 4. delete "); printf(" 5. quit "); }

int main(int argc, char *argv[]) {

struct record * start = NULL; int tempaccNum; int accNum = 0; int ch; do { menu(); printf("Enter your choice: "); scanf("%d", &ch); printf(" "); // Accepts data for new customer if (ch == 1) { printf(" Enter account number: "); scanf("%d", &accNum); printf(" Enter name: "); scanf("%s", name); printf(" Enter mailing address: "); getaddress(); // Can you use fgetsc in here to get character array to store string not sure how to code it properly

Sample Output must look like this

Greetings, what do you want to do with the database? ------------------------------------------------------------------------

1. add 2. printall 3. find 4. delete 5. quit Enter your choice: 1

Enter account number: 111

Enter name: John Doe

Enter Address: 13 Street Ave

Brooklyn

NY, 10011

You don't need to complete the code I just need the getaddress part to somehow work thanks.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!