Andrew H.

asked • 01/27/21

C programming output

Output? What would happen if we call the following function?


printf(“\n\n%d\n\n”, funD(pList));

//pList: 20 40 50 10


int funD( NODE *pList )

{

NODE **ptr;

ptr = &pList;

while ( *ptr )

{

ptr = &((*ptr) ->link);

}

*ptr = pList;

printf(“\n\n%d\n\n”, (*ptr)->link->data);

return (*ptr)->data;

}



1 Expert Answer

By:

Inactive Tutor answered • 01/27/21

Tutor
New to Wyzant

Andrew H.

Can you explain which part causes these errors
Report

01/27/21

Inactive Tutor

I'm sure there are several. First the function must be declared ahead of the caller. Then the definitions are needed for the Node and list. Then you have to declare the pList
Report

01/27/21

Inactive Tutor

Tell me what you are trying to do and maybe I can help
Report

01/27/21

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.