Enviado em 04/12/2021 - 04:03h
Bom dia a Todos.#include <stdio.h>
char *strcat_for(char *Dest, char *Src) {
int x = 0;
for( ; Dest[x] != '\0'; x++);
for(int y = 0; Src[y] != '\0'; y++, x++)
Dest[x] = Src[y];
Dest[x] = '\0';
return Dest;
}
char *strcat_while(char *Dest, char *Src) {
while(*Dest)
Dest++;
while(*Src)
*Dest++ = *Src++;
*Dest = '\0';
return Dest;
/* Mesmo sem usar ponteiros não funciona igual ao for
int x = 0, y = 0;
while(Dest[x] != '\0')
Dest++;
while(Src[y] != '\0')
Dest[x++] = Src[y++];
Dest[x] = '\0';
return Dest;
*/
}
int main(void) {
char for1[15] = "for", while1[15] = "while", End[] = " 2022";
puts(strcat_for(for1, End)); // Funciona!
//puts(strcat_while(while1, End)); // Não funciona, não imprime, Porque?
// O While só funciona assim, Porque?
strcat_while(while1, End);
puts(while1);
}
Criar entrada (menuentry) ISO no Grub
Como gerar qualquer emoji ou símbolo unicode a partir do seu teclado
Instalar o VIM 9.1 no Debian 12
Como saber o range de um IP público?
Muitas dificuldades ao instalar distro Linux em Notebook Sony Vaio PCG-6131L (VPCEA24FM)
Slackpkg+ (Slackpkg Plus) está de volta!
Como dividir duas janelas igualmente e lado-a-lado na sua tela
Problemas com SQL em objeto TLabel ... (1)
Youtube e networkmeneger para de funcionar (5)
Minha rede tem um espaço invisível que não dá pra digitar o nome da re... (1)
Pedagogia no brasil não passa de alfabetização por m4sturbação mental ... (2)