Linked List ADT

I am working on a project that require us to use linked list abstract data type.This is what I have got so far, but I am not sure what I am doing wrong.
I'm getting this error. Line 25: invalid conversion from const to char
Please help me.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#include<iostream>
using namespace std;

class LinkedList
{
private:
struct ListNode
{
char value;
ListNode *next;
};

ListNode *head; // head pontier

public:
LinkedList()
{head = NULL;} // constructor
void insert(char);
};

int main()
{
LinkedList l;

l.insert("t");
l.insert("c");
l.insert("a");


String literals such as "t" are of type const char *, whereas your function expects a single char. Maybe you meant to use single quotes? 't'
Thank you it does work
Topic archived. No new replies allowed.