仅个人笔记
#include<iostream> using namespace std; int main() { char str[] = "2232344434"; for (int i = 0; i < strlen(str); i++) { printf("%c", *(str+i)); } const char* arr = "12343545"; for (int i = 0; i < strlen(arr); i++) { printf("%c", *(arr + i)); } char str[] = {'1','2','3','4','\0'}; for (int i = 0; i < strlen(str); i++) { printf("%c", *(str+i)); } }
前两个字符串常量都不可以改变