Can someone provide basic code for linked lists? Here is the outline of what I need it for. I understand what a linked list is, unfortunately I haven't done it in C before or have forgotten.
#include <stdio.h>
struct nlist
{
struct nlist *next;
char *name;
};
static struct nlist *usersList;
main ()
{
add("user1");
remove("user2");
}
int add (char *s)
{
//can't figure out code
}
int remove
{
//can't figure out code
}
#include <stdio.h>
struct nlist
{
struct nlist *next;
char *name;
};
static struct nlist *usersList;
main ()
{
add("user1");
remove("user2");
}
int add (char *s)
{
//can't figure out code
}
int remove
{
//can't figure out code
}