A common question in Infosys interview questions, don't miss this one. Struct is a specialized data type that includes various sorts of data. As an example,  struct Student {
int rollNumber;
char section;
void getName();
}; Members of a class are by default private; to make a variable public, we must use the public modifier. Members in a struct are always public by default, and we must apply a modifier to make them private.  Structs cannot be inherited, but classes may.