#include <iostream>
int main()
{
struct student
{
int roll;
int age;
};
studentS1={100,15}
studentS2=S1;
if(S1==S2)
std::cout<<"The structures are equal";
else
std::cout<<"The structures are not equal";
}
}
THE ERROR -Compilation failed due to following errors-
main.cpp: In function 'int main()':main.cpp:17:5: error: 'studentS1' was not declared in this scope studentS1={100,15} ^main.cpp:19:8: error: 'S1' was not declared in this scope if(S1==S2) ^main.cpp:19:12: error: 'S2' was not declared in this scope if(S1==S2) ^main.cpp: At global scope:main.cpp:24:1: error: expected declaration before '}' token } ^
The last bracket (}) should not be there.
studentS1={100,15} → should be student S1={100,15};
studentS2=S1; → should be student S2=S1;
if(S1==S2) → This is wrong. You can’t compare two structures.
Osh University sets the stage for your medical aspirations with its bachelor of medicine program. Dive into a world-class education that blends theoretical knowledge with hands-on experience, preparing you for the challenges of the ever-evolving medical landscape.
Shalamar Hospital is your trusted healthcare destination, offering the expertise of a renowned stomach specialist . Expect top-notch care for gastrointestinal health.
New Questions |
---|
trustworthy online casino in New Zealand - C
|
SSM Exam - Other
|
SPC Exam - Other
|
SAFe-Practitioner Exam - Other
|
SAFe-Agilist Exam - Other
|
P_SAPEA_2023 Exam - Other
|
POPM Exam - Other
|