-2
我在C++程序中顯示了單引號和答案,我得到的是隨機數字,因爲當我在C++中使用雙引號時,它向我顯示語句。在C++中顯示時使用單引號和雙引號的不同答案
cout << 'Hello world'; //gave me the random numbers
cout << "Hello world"; //displayed me the statement i.e Hello world
爲什麼發生這種情況請讓我知道,那些隨機數在執行時是什麼?
「是字符,單個的人,,使用‘’請爲字符串,隨機你與正在看到的東西」是本機的內存轉儲從字符開始到第一個\ 0 – Gar
看到這個:http://stackoverflow.com/questions/3960954/c-multicharacter-literal – Nim
這是一個多字符文字,檢查這個職位: http://stackoverflow.com/questions/7459939/what-do-single-quotes -DO-在-C-時使用的上,多字符 –