Insert a string into another string efficiently

后端 未结 4 1862
清歌不尽
清歌不尽 2021-01-07 05:10

I have

char aa[] = { \"Hello, !\" };

char bb[] = { \"World\" };

How to insert bb into aa the most efficiently with cstring

4条回答
  •  情歌与酒
    2021-01-07 05:43

    std::string aa = "Hello, !";
    std::string bb = "World";
    aa.insert(7, bb);
    

    dont wanna use string from C++

    Then why are you tagging this as C++?

提交回复
热议问题