執行 ❯
建立您
自己的
網站
×
更改方向
更改主題,深色/淺色
前往 Spaces
#include <stdio.h> #include <string.h> struct myStructure { int myNum; char myLetter; char myString[30]; // String }; int main() { struct myStructure s1; // Assign a value to the string using the strcpy function strcpy(s1.myString, "Some text"); // Print the value printf("My string: %s", s1.myString); return 0; }
我的字串:一些文字