字串
user_3763047219
c_cpp
2 years ago
443 B
3
Indexable
#include <iostream> #include <stdio.h> #define _CRT_SECURE_NO_WARNING #include <ctype.h> #include <string.h> #define ARRAYSIZE 100 #define STRINGLEN 80 int main() { int students[ARRAYSIZE]; //char s[STRINGLEN] = { 'm','o','r','n','i','n','g','\0' }; char s[STRINGLEN] = "good morning"; printf("%d\n", sizeof(s)); printf("%d\n", strlen(s)); for (int i = 0; i < strlen(s); i++) { printf("%c", s[i]); } printf("\n"); }
Editor is loading...