Run ❯
×
Change Orientation
Change Theme, Dark/Light
#include
struct myStructure { int myNum; char myLetter; }; int main() { // Create different struct variables struct myStructure s1; struct myStructure s2; // Assign values to different struct variables s1.myNum = 13; s1.myLetter = 'B'; s2.myNum = 20; s2.myLetter = 'C'; // Print values printf("s1 number: %d\n", s1.myNum); printf("s1 letter: %c\n", s1.myLetter); printf("s2 number: %d\n", s2.myNum); printf("s2 letter: %c\n", s2.myLetter); return 0; }
s1 number: 13
s1 letter: B
s2 number: 20
s2 letter: C