Advertisement
Guest User

Untitled

a guest
May 21st, 2018
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. #include <stdio.h>
  2. #include<stdlib.h>
  3. #include <string.h>
  4. #define nmax 50
  5.  
  6. void popola(char str[]);
  7. void stampa(char str[]);
  8. void copia(char str1[],char str2[]);
  9. void unisci(char str1[], char str2[]);
  10.  
  11. main(){
  12.  
  13. int n=nmax;
  14. char s1[n],s2[n],s3[n];
  15.  
  16. popola(s1);
  17. stampa(s1);
  18. popola(s2);
  19. stampa(s2);
  20. copia(s1,s3);
  21. unisci(s2,s3);
  22. stampa(s3);
  23.  
  24. }
  25. void popola(char str[]){
  26.  
  27. printf("Inserisci il valore della stringa\n");
  28. gets(str);
  29.  
  30. }
  31.  
  32. void stampa(char str[]){
  33.  
  34. printf("\n%s\n\n",str);
  35.  
  36. }
  37.  
  38. void copia(char str1[],char str2[]){
  39.  
  40. strcpy(str2,str1);
  41.  
  42. }
  43.  
  44. void unisci(char str1[],char str2[]){
  45.  
  46. strcat(str2,str1);
  47.  
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement