neu in C++ - Codierung und versuchte, eine Hand von eindeutigen Zeigern zu bekommen. Ich laufe in 3 FehlerC++ Syntax- und Compiler-Fehler - keine Übereinstimmung für Operator <<
1.cpp|14|error: no match for 'operator<<' 2.cannot bind 'std::basic_ostream<char>' lvalue to std::basic_ostream<char>&&
#include <iostream>
#include <memory>
using std::cout;
using std::cin;
using std::endl;
using std::make_unique;
int main(){
auto ptr = make_unique<int>(4);
cout << "The value of ptr: " << ptr << endl;
cout << "The value of ptr: " << &ptr;
}
Sie dereferenzieren müssen 'ptr':' cout << "Der Wert von ptr:" << * ptr << endl; ' – ildjarn