怎么将单个字符赋值给 string 变量

2025-05-04 20:11:03
推荐回答(1个)
回答1:

直接用=赋值就可以了。举例如下: //#include "stdafx.h"//If the vc++6.0, with this line.#include #include using namespace std;int main(void){ string s; s="ABC"; cout