Hey Guys, merry christmas
cout << *ptr << endl; ANDCode:#include <iostream> #include <cstring> using namespace std; int main() { char * ptr; char input[16]; cout << "Enter something" << endl; cin >> input; ptr = new char[strlen(input) + 1]; cout << *ptr << endl; delete[] ptr; return 0; }
cout << ptr << endl;
Return unexpected results, could someone please explain to me why that is, and I guarantee the answer will cause me to have a learning curve
Thanks alot, appreciate your replies.