home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / progm / ctutor2.zip / ANSWERS / CH07_1.C < prev    next >
Text File  |  1989-11-10  |  866b  |  37 lines

  1. main()
  2. {
  3. int index;
  4. char string1[6], string2[6], string3[6], all_three[18];
  5.  
  6.    strcpy(string1,"one");
  7.    strcpy(string2,"two");
  8.    strcpy(string3,"three");
  9.  
  10.    strcpy(all_three,string1);
  11.    strcat(all_three," ");
  12.    strcat(all_three,string2);
  13.    strcat(all_three," ");
  14.    strcat(all_three,string3);
  15.  
  16.    for(index = 0;index < 10;index = index + 1)
  17.       printf("The final string is ---> %s\n",all_three);
  18.  
  19. }
  20.  
  21.  
  22.  
  23. /* Result of execution
  24.  
  25. The final string is ---> one two three
  26. The final string is ---> one two three
  27. The final string is ---> one two three
  28. The final string is ---> one two three
  29. The final string is ---> one two three
  30. The final string is ---> one two three
  31. The final string is ---> one two three
  32. The final string is ---> one two three
  33. The final string is ---> one two three
  34. The final string is ---> one two three
  35.  
  36. */
  37.