C++ to C: Strings

Discussion in 'C++' started by bconnor, Apr 4, 2006.

  1. bconnor

    bconnor New Member

    Joined:
    Apr 4, 2006
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0
    Code:
    string s = "we";
    string s2 = "I";
    s.replace( 0, s2.length(), s2 );
    cout << s << endl;   

    There isnt a simple way to do something like this in C, is there?
     
  2. coderzone

    coderzone Super Moderator

    Joined:
    Jul 25, 2004
    Messages:
    736
    Likes Received:
    37
    Trophy Points:
    28
    What do you mean by C. Do you mean with the char array?
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice