Oi, alguém pode me dar uma ajuda, inicializei a string str com um \0, para que não fique nenhum lixo, só que está dando erro
[code]#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main()
{
char str[11],str1[11],str2[11],str3[11],str4[11];
printf ("Entre com a string 1: ");
gets(str1);
printf ("Entre com a string 2: ");
gets(str2);
printf ("Entre com a string 3: ");
gets(str3);
printf ("Entre com a string 4: ");
gets(str4);
str='[code]#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main()
{
char str[11],str1[11],str2[11],str3[11],str4[11];
printf ("Entre com a string 1: ");
gets(str1);
printf ("Entre com a string 2: ");
gets(str2);
printf ("Entre com a string 3: ");
gets(str3);
printf ("Entre com a string 4: ");
gets(str4);
str='\0';
strcat(str,str1);
strcat(str,str2);
strcat(str,str3);
strcat(str,str4);
printf ("String Concatenada: %s");
system("PAUSE");
return (0);
}
[/code]’;
strcat(str,str1);
strcat(str,str2);
strcat(str,str3);
strcat(str,str4);
printf ("String Concatenada: %s");
system("PAUSE");
return (0);
}
[/code]