Run ❯
Get your
own
website
×
Change Orientation
Change Theme, Dark/Light
Go to Spaces
#include
struct myStructure { int myNum; char myLetter; char myString[30]; // String }; int main() { struct myStructure s1; // Trying to assign a value to the string s1.myString = "Some text"; // Trying to print the value printf("My string: %s", s1.myString); return 0; }
prog.c: In function �main�:
prog.c:12:15: error: assignment to expression with array type
12 | s1.myString = "Some text"; // Assign a value to the string
| ^