将字符串指针赋值给数组[通俗易懂] 大家好,又见面了,我是你们的朋友全栈君。 比如char *p=”sdflkjasljfsjlsdfsa”; char p1[200]; 将p赋给p1 (1)strcpy(p1,p); (2)char *src=”helloworld”; char des[100]={0}; memcpy(des,src,strlen(src)+1); //void *memcpy(void *str1, const void ...
typedef struct _LINE { char a;char b;int c;}LINE;LINE result[100];memset(result, 0, sizeof(LINE)*100);FILE *fp = fopen("f2.txt","r");if (NULL == fp){ printf("Open Config File Error\n");return ;} int res = 0;char buffer[MAX_PATH] = {0};int i = 0;for...
也就是说,数组的每个元素都有char *类型。因此,要指定一个指向字符串字面量(第一个字符)的指针,...