Run ❯
Get your
own
website
×
Change Orientation
Change Theme, Dark/Light
Go to Spaces
#include
#include
// Create a structure struct myStructure { int myNum; char myLetter; char myString[30]; }; int main() { // Create a structure variable and assign values to it struct myStructure s1 = {13, 'B', "Some text"}; // Modify values s1.myNum = 30; s1.myLetter = 'C'; strcpy(s1.myString, "Something else"); // Print values printf("%d %c %s", s1.myNum, s1.myLetter, s1.myString); return 0; }
30 C Something else