cstring與string標頭檔案與輸出

2021-07-27 17:20:18 字數 352 閱讀 9616

在使用了mfc庫的工程中cstring可以直接使用,在沒有使用mfc庫的工程中 先

右擊專案-->屬性-->配置屬性-->常規,然後在右邊的「專案預設值」中的「mfc的使用」選項中選擇「在共享 dll 中使用 mfc」,注意開啟屬性後,配置項的選擇要和當前使用的配置統一。然後再新增標頭檔案

#include 

可能vs太強大,實際上#include 或#include 都可以使用,隨便挑乙個標頭檔案就好了。

要使用stl裡的string,要加入

#include 

注意,不是string.h

然後在**的前面寫

using namespace std;

就可以了

C String與string的區別

c 中同時存在string與string msdn中對string的說明 string is an alias for string in the net framework。string是string的別名而已,string是c 中的類,string是framework的類,c string 對映...

C string與String的區別

最近,正在簡單地學習c 的一些知識。c 是區分大小寫的,但是我卻發現c 中同時存在string與string,於是我很困惑,於是我上網搜尋了一下,於是我了解了一些小知識。msdn中對string的說明 string is an alias for string in the net framewor...

C String與string的區別

c string與string的區別 c 是區分大小寫的,但是我卻發現c 中同時存在string與string,於是我很困惑,於是我上網搜尋了一下,於是我了解了一些小知識。msdn中對string的說明 stringis analiasforstringin the net framework。st...