How do you assign a variable in one of the member construct in C?
I used the brackets after the name variable, but I still do not under stand why I am getting error messages. I know that C does not support string, but an array could be used to store string values: Here is my code: #include <stdio.h> struct Student{ char name[12]; int age; }; int main(){ struct Student s1; struct Student s2; s1.name[12] = "Shubham"; s1.age = 21; s2.name = "Gargi"; s2.age = 13; printf("\nName: %s \n Age: %d ",s1.name,s1.age); printf("\nName: %s \n Age: %d ",s2.name,s2.age); } Terminal: ERROR! gcc /tmp/65wVAJrLIS.c -lm /tmp/65wVAJrLIS.c: In function 'main': /tmp/65wVAJrLIS.c:13:17: warning: assignment to 'char' from 'char *' makes integer from pointer without a cast [-Wint-conversion] 13 | s1.name[12] = "Shubham"; | ^ /tmp/65wVAJrLIS.c:16:13: error: assignment to expression with array type 16 | s2.name = "Gargi"; |