-2

What does the ** operator mean? The "int *or" is just making sure it's gonna be a int pointer as the second argument but what does the "Item **w1" do?

for example;

typedef struct item{
 int data;
 struct item *next;
} Item;

void Inp(Item **w1, char c[], int *or) //writing numbers to a list
{
*or = scanf("%s" , c);
Conv(w1, c);
}
Estonia_girl
  • 83
  • 2
  • 3
  • 8
  • 1
    `Item **w1` is a pointer to a pointer to a `Item`. In other words, it is a double pointer, i.e, it points to the address of a pointer pointing to the address of `Item`. – Spikatrix Aug 23 '15 at 12:16
  • 2
    "double pointer" is a *dangerous* expression (there is no `double` in sight). I prefer "pointer to pointer" – pmg Aug 23 '15 at 12:18

1 Answers1

3

Item **w1 is a pointer to a pointer to Item.

Danke Xie
  • 1,757
  • 17
  • 13