Find the error in each of the following:

a) Assume that struct Card has been defined as containing two pointers to type char—namely, face and suit. Also, the variable c has been declared to be of type Card, and the variable cPtr has been declared to be of type pointer to Card. Variable cPtr has been assigned the address of c.
cout << *cPtr.face << endl;
b) Assume that struct Card has been defined as containing two pointers to type char—namely, face and suit. Also, the array hearts[ 13 ] has been declared to be of type Card. The following statement should print the member face of element 10 of the array.
cout << hearts.face << endl;
c) ```
struct Person
{
char lastName[ 15 ];
char firstName[ 15 ];
int age;
} // end struct Person
```
d) Assume that variable p has been declared as type Person and that variable c has been declared as type Card.
p = c;


a) Error: The parentheses that should enclose *cPtr have been omitted, causing the order of evaluation of the expression to be incorrect.
b) Error: The array subscript has been omitted. The expression should be
hearts[ 10 ].face.
c) Error: A semicolon is required to end a structure definition.
d) Error: Variables of different structure types cannot be assigned to one another.

Computer Science & Information Technology

You might also like to view...

A(n) ________ is an Access database that is split into two files — one containing the back end and one containing the front end

A) split database B) application database C) linked database D) SQL database

Computer Science & Information Technology

________ is a limited-function OneDrive version of OneNote 2013

Fill in the blank(s) with correct word

Computer Science & Information Technology

Computers are better than humans where there seems to be a high level of complexity, approximation, or ambiguity.

Answer the following statement true (T) or false (F)

Computer Science & Information Technology

In a client/server network, each network node communicates directly with every other node on the network.

Answer the following statement true (T) or false (F)

Computer Science & Information Technology