How do I pass a pointer to a linked list and check to see if it's empty??

Hi! I'm new to coding and c++. Is it possible to pass a linked list to a function with a pointer? I created a struct for the list:


struct List
{
char letters;
List *next;
};

and the function I'm passing to..

bool isEmpty (*List)
{
if (List == NULL)
return true;
}

I just started programming a month ago so any help is greatly appreciated!
closed account (48bpfSEw)
lesson 15

http://www.cprogramming.com/tutorial/lesson15.html
I read that but it didn't answer my question... I don't want to pass the pointer for the root of the list, is it possible to pass the list itself? Or is it only able to be done with the root?
closed account (48bpfSEw)
You are operating with pointers in C++.

It is not possible e.g. to pass a hole image to a function, but a pointer to an address where the image is stored.
Why do you want to mess around with pointers and lists? C++ comes with a list already.
http://www.cplusplus.com/reference/list/list/

There is little benefit to learn these things unless it's a requirement of a course.
closed account (48bpfSEw)
@Tom, that's the way I like it! ^^ Don't treat a beginner as a beginner! Treat them all as a full professional! We can only show them the door... and the fantastic possibilities which c++ has in petto. There are no secrets. Everything is revealed. There is only one thing which prevents one from creating wonderful applications: no try

happy codings everone! ^^
Necip wrote:
Don't treat a beginner as a beginner!

+1 for that :D
closed account (48bpfSEw)
... and the other side of the coin:

don't treat a pro as a pro! ^^

wisedom is nothing if one lost the ability to look at the things as a child!

Topic archived. No new replies allowed.