第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

程序運行到這里的時候出現(xiàn)故障 但是并非是調(diào)試出錯 而是運行之后程序不能繼續(xù)運行有點像“無響應(yīng)”

程序運行到這里的時候出現(xiàn)故障 但是并非是調(diào)試出錯 而是運行之后程序不能繼續(xù)運行有點像“無響應(yīng)”

C++
莫回?zé)o 2023-04-20 19:15:07
請問一下這個函數(shù)的具體用法void set_about(string about){for(int i = 0;i < (int)(about.length() / 2) / 30 && i < 25;i++)for(int j = 0;j <= 29;j++){if(about.substr(i * 30 * 2 + j * 2,2) == LINEFEED)about.insert(i * 30 * 2 + j * 2,BLANK,0,2);set_pixel(i + 8,j + 8,about.substr(i * 30 * 2 + j * 2,2));}for(int i = 0;i < (about.length() / 2) % 30;i++)set_pixel((int)(about.length() / 2) / 30 + 8,i + 8,about.substr((int)((about.length() / 2) / 30) * 30 * 2 + i * 2,2));}以上是我所寫的一個函數(shù),其中set_pixel()是用于打點的,在此之前此函數(shù)并未出現(xiàn)故障 而LINEFEED 和 BLANK是字符串常量,
查看完整描述

2 回答

?
收到一只叮咚

TA貢獻1821條經(jīng)驗 獲得超5個贊

string的成員函數(shù)insert有以下多種重載:

string &insert(int p0, const char *s);——在p0位置插入字符串s

string &insert(int p0, const char *s, int n);——在p0位置插入字符串s的前n個字符

string &insert(int p0,const string &s);——在p0位置插入字符串s

string &insert(int p0,const string &s, int pos, int n);——在p0位置插入字符串s從pos開始的連續(xù)n個字符

string &insert(int p0, int n, char c);//在p0處插入n個字符c

iterator insert(iterator it, char c);//在it處插入字符c,返回插入后迭代器的位置

void insert(iterator it, const_iterator first, const_iteratorlast);//在it處插入從first開始至last-1的所有字符

void insert(iterator it, int n, char c);//在it處插入n個字符c

以下是第二行性能的舉例代碼:


//#include "stdafx.h"//If the vc++6.0, with this line.#include <string>#include <iostream>using namespace std;//int main(void){    string a="1234567890",b="abcdefghijklmn";    a.insert(3,b,5,4);    cout << a << endl;    return 0;}

輸出是123fghi4567890.


查看完整回答
反對 回復(fù) 2023-04-23
?
泛舟湖上清波郎朗

TA貢獻1818條經(jīng)驗 獲得超3個贊

string-》c風(fēng)格字符串要轉(zhuǎn)換的。成員函數(shù)c_str();

查看完整回答
反對 回復(fù) 2023-04-23
  • 2 回答
  • 0 關(guān)注
  • 162 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號