Pointer Issue

Hey guys beginner here. Error is "left of '->next' '->ID' and '->name' must point to class/struct/union/generic type". Also Visual Studio is telling me 'expression must have a pointer type'. I only included my void function since I think the problem only is contained here.

I think the problem definitely is dealing with the declarations of the variables. I think I might not have declared the pointers correctly.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
  void LinkedList::printOne()
{
	int input;
	int tmp;
	int name;

	if (p == NULL)
	{
		cout << "No output" << endl;
		return;
	}
	else
	{
		cout << "index :";
		cin >> input;
		int count = 0;
		while (count != input)
		{
			count += 1;
			tmp = tmp->next ;
		}
		cout << tmp->ID << "\t" << *tmp->name << endl;
	}
}

Error is "left of '->next' '->ID' and '->name' must point to class/struct/union/generic type".
 
int tmp;
Topic archived. No new replies allowed.