运行 ❯
获取您
自己的
网站
×
更改方向
更改主题,深色/浅色
转到 Spaces
#include <stdio.h> 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 数字:13
s1 字母:B
s2 数字:20
s2 字母:C