0
struct student { int age; int grade; char name[40]; }; int main() { struct student s1 ={ .age = 18,.grade = 7
Can any one tell what's wrong in this code?
3 Answers
+ 8
Your code is cut off. Please save it as a playground project and link that here or, if it fits, paste it into the description rather than the title, otherwise we won't be able to tell what the issue is.
+ 2
Mate u missed '.' before "name":
struct student s1 ={ .age = 18,.grade = 78, name = "anjali sharma"};
Should be :
struct student s1 ={ .age = 18,.grade = 78, .name = "anjali sharma"};
Also isn't it easier to just write:
struct student s1 ={ 18, 78, "anjali sharma"};
???
+ 1
Okk now I understand thank you.. ..