C++ primer plus

  給cout指針,默認打印指針地址,但如果指針的類型的char*,將打印指向的字符串,如果要顯示的是字符串的地址,將指針強制轉換爲另一種類型 char* animal cout << animal << endl;//默認顯示指針指向的字符串 cout << (int *)animal << endl;//將顯示字符串的地址 (int *)animal 顯示的是字符串的地址   char * p
相關文章
相關標籤/搜索