Strings in the structure
struct myStructure {
int myNum;
char myLetter;
char myString[30]; // String
};
int main() {
struct myStructure s1;
strcpy(s1. myString, "Some text");
// print value
printf("my string: %s", s1.myString);
return 0;
}
Assigning values ââto strings using the strcpy
function
Comments