Which of the following struct definitions is correct in C++?
A) struct studentType
{
int ID;
};
B) struct studentType
{
string name;
int ID;
double gpa;
}
C) int struct studentType
{
ID;
}
D) struct studentType
{
int ID = 1;
};
Correct Answer:
Verified
Q1: In structs, you access a component by
Q2: The components of a struct are called
Q5: A struct is typically a _ data
Q7: Typically, in a program, a struct is
Q10: You can declare struct variables when you
Q11: The syntax for accessing a struct member
Q12: Aggregate input/output operations are allowed on a
Q13: Relational operations can be used on struct
Q14: A function can return a value of
Q17: You can use an assignment statement to
Unlock this Answer For Free Now!
View this answer and more for free by performing one of the following actions
Scan the QR code to install the App and get 2 free unlocks
Unlock quizzes for free by uploading documents