为什么我的字符串拼接不了啊 谢谢指教
#include <stdio.h>int main(void)
{
char str1[40]="to be or not to be";
char str2[]=",that is the question";
int count1=0;
int count2=0;
while (str1[count1])
count1++;
while (str2[count2]);
count2++;
if(sizeof str1< count1+count2+1)
printf("\nYou can't put a quart into a pint pot.");
else
{
count2=0;
while(str2[count2])
str1[count1++]=str2[count2++];
str1[count1]='\0';
printf("\n%s\n",str1);
}
getch();
return 0;
}
为什么我这个输入是空的