Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<conio.h>
- #include<stdlib.h>
- #include<stdio.h>
- #include<string.h>
- #define TF 100
- void LeTexto (char texto[TF])
- {
- printf("Digite o texto");
- gets(texto);
- }
- void Exibe(char texto[TF])
- {
- printf("\nDigite o texto:%s\n", texto);
- getch();
- }
- void ConcatenaChr(char texto[TF], char letra)
- {
- texto[strlen(texto)+1]='\0';
- texto[strlen(texto)]=letra;
- }
- void ConcatenaSte(char Frase[TF], char Aux[TF])
- {
- ConcatenaChr(Frase, ' ');// ou strcat(Frase+" "); obs: entre aspas;
- strcat(Frase, Aux);
- }
- void Modifica(char texto[TF], char Aux[TF])
- {
- int pos;
- printf("\nDigite a Posicao:\n");
- scanf("%d", &pos);
- }
- char LeChr(void)
- {
- printf("\nCaractere:");
- return getch();
- }
- int main(void)
- {
- char F[TF], caracter, Aux[TF];
- LeTexto(F);
- ConcatenaChr(F, LeChr());
- Exibe(F);
- LeTexto(Aux);
- ConcatenaChr(F, LeChr());
- Exibe(F);
- Modifica(F, Aux);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement