Loop to keep adding spaces in string?

前端 未结 1 914
被撕碎了的回忆
被撕碎了的回忆 2021-01-24 05:12

I have the following code:

sHexPic = string_to_hex(sPic);
    sHexPic.insert(sHexPic.begin() + 2,\' \');
    sHexPic.insert(2,\" \");

I would l

1条回答
  •  盖世英雄少女心
    2021-01-24 05:54

    Here's how it would be done in C++, using a string :) (I'm using C libraries cuz I'm more familiar with C)

    #include 
    #include 
    
    using namespace std;
    
    int main()
    (
       string X;
       int i;
       int y;
    
       X = 35498700;
       y= X.size();
    
       for(i=2;i

    Have fun :)

    That would "probably" work. If it didn't then please mention so :)

    0 讨论(0)
提交回复
热议问题