如何将两个字符串当作变量添加在一起?

时间:2018-09-29 19:34:55

标签: c++

如何将两个字符串当作变量添加在一起? 例如:

std::cout<< a << b << std::endl;

如何仅使用两个字符串ab来做到这一点?

1 个答案:

答案 0 :(得分:1)

您不能存储由一系列整数字符组成的名称。请改用// management of online / offline mode $c_OnOffLine = 'off'; if ($wampConf['status'] == 'online') { $tpl = str_replace('images_off.bmp', 'images_on.bmp',$tpl); $tpl = str_replace($w_serverOffline, $w_serverOnline,$tpl); $tpl = str_replace('onlineOffline.php on', 'onlineOffline.php off', $tpl); $tpl = str_replace($w_putOnline,$w_putOffline,$tpl); $c_OnOffLine = 'on'; } // management of item put online if($wampConf['MenuItemOnline'] == 'on') { $changeServMenu = ';WAMPPUTONLINE '; $changeServMenu .= <<< EOF Type: item; Caption: "${w_putOnline}"; Action: multi; Actions: onlineoffline EOF; $tpl = str_replace(';WAMPPUTONLINE',$changeServMenu,$tpl); $changeServMenu = ';WAMPONLINEOFFLINESTART '; $changeServMenu .= <<< EOF [onlineoffline] Action: run; FileName: "${c_phpExe}"; Parameters: "onlineOffline.php on";WorkingDir: "${c_installDir}/scripts"; Flags: waituntilterminated Action: run; FileName: "${c_phpCli}"; Parameters: "refresh.php";WorkingDir: "${c_installDir}/scripts"; Flags: waituntilterminated Action: service; Service: ${c_apacheService}; ServiceAction: restart; Action: resetservices; Action: readconfig; EOF; $tpl = str_replace(';WAMPONLINEOFFLINESTART',$changeServMenu,$tpl); }