Thread: fancy strcpy

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #9
    Registered User
    Join Date
    Oct 2001
    Posts
    2,934
    Here's one way:
    Code:
    char message[80];
    
    strcpy(message,"Hello");
    strcat(message," world");
    cout << message << endl;
    Or:
    Code:
    char message[80];
    char word[10];
    
    strcpy(message,"Hello");
    strcpy(word," world");
    strcat(message,word);
    cout << message << endl;
    Or with string types I think you can:
    Code:
    string message = "Hello" + " world";
    Last edited by swoopy; 04-30-2002 at 01:07 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. A Full Program to analyze.
    By sergioms in forum C Programming
    Replies: 2
    Last Post: 12-30-2008, 09:42 AM
  2. Strcpy
    By Godders_2k in forum C Programming
    Replies: 17
    Last Post: 12-12-2007, 12:34 PM
  3. Where is strcpy() defined? (Can't find in string.h ect)
    By Zero_Point in forum C++ Programming
    Replies: 6
    Last Post: 04-03-2006, 05:14 PM
  4. Question about strcpy
    By Kevinmun in forum C Programming
    Replies: 4
    Last Post: 11-02-2005, 11:00 PM
  5. strcpy
    By Luigi in forum C++ Programming
    Replies: 17
    Last Post: 02-16-2003, 04:11 PM