Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
#include <iostream> #include <string> using namespace std; int main() { string *ptr = new string("fff"); string * ptr1 = new string("ffffff"); cout << ptr << endl << ptr1 << endl; }
ptr と ptr1 の表現がどのように異なるのですか? *ptr は *[space]ptr と同じことを意味しますか?
はい、同じ意味です。この場合、空白は違いはありません (実際、C++ ではほとんどの場合)。