. What wrong with the following code segment?
int* = needle;
needle = new int;
*needle 100;
cout << *needle;
needle = new int;
*needle = 32;
cout << *needle;
. What wrong with the following code segment?
int* = needle;
needle = new int;
*needle 100;
cout << *needle;
needle = new int;
*needle = 32;
cout << *needle;
lines 1 and 3 are not valid statements. Also, there is a memory leak on line 4 because it doesn't delete the pointer allocated on line 2.
int* = needle doesn't make sense and *needle 100 have you even tried running it in a compiler?
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.