idastan97

CSCI151 L20 P4

Oct 18th, 2016
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.34 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. void concat(char str1[], char str2[], char resultStr[]){
  4.     int i;
  5.     for (i=0; str1[i]!='\0'; i++)
  6.         resultStr[i]=str1[i];
  7.     int j;
  8.     for (j=0; str2[j]!='\0'; i++, j++)
  9.         resultStr[i]=str2[j];
  10.     resultStr[i]='\0';
  11. }
  12.  
  13. int main(void) {
  14.     char p[80];
  15.     concat("Dastan ", "Iyembergen", p);
  16.     printf("%s", p);
  17.     return 0;
  18. }
Advertisement
Add Comment
Please, Sign In to add comment