Hye! It's giving error when I compare head[i] with "del". How would I dereference head[i] to be able to compare it with "del". I am bound to make head double pointer as a global variable . Thanks!
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
node **head;
int main()
{
int del;
cout << "Enter size of array:" << endl;
cin >> size;
head = new node *[size];
..................further code to enter elements in this array............
cout << "Enter element to be deleted : ";
cin >> del;
for (int i = 0; i< size; i++)
{
if (head[i] == del) // ERROR operands type incompbatible
{
@Repeater
We dereferce a simple array by : cout <<array[i] ; and it will print the values
So why not head[i] will print the values? Yes, it is a pointer to a node! But how can I dereference the value of this array? I have to then delete a certain value which user wants by comparing it with "del"!
@seokiller I am also a big fan of sandeep sir!