views:

550

answers:

2

Hi folks,

I'm trying to implement a linked list but get a intSLLst.cpp:38: error: ‘intSLList’ has not been declared error when compiling. intSLList looks like it's been declared to me though so I'm really confused.

intSLLst.cpp

#include <iostream>
#include "intSLLst.h"


int intSLList::deleteFromHead(){
}

int main(){

}

intSLLst.h

#ifndef INT_LINKED_LIST
#define INT_LINKED_LIST
#include <cstddef>

class IntSLLNode{
  int info;
  IntSLLNode *next;

  IntSLLNode(int el, IntSLLNode *ptr = NULL){
    info = el; next = ptr;
  }

};

class IntSLList{
 public:
  IntSLList(){
    head = tail = NULL;
  }

  ~IntSLList();

  int isEmpty();
  bool isInList(int) const;

  void addToHead(int);
  void addToTail(int);

  int deleteFromHead();
  int deleteFromTail();
  void deleteNode(int);

 private:
  IntSLLNode *head, *tail;

};

#endif

EDIT: Thanks for the help. I wish there was some way to delete this question because it's really stupid.

+7  A: 

intSLList isn't the same as IntSLList. This isn't Pascal. C++ is case sensitive.

sbi
+1 for being more specific
advs89
Now, why would someone vote this down? And Alex's, too? Smells fishy.
sbi
+10  A: 

You're using a lower case i

int intSLList::deleteFromHead(){
}

should be

int IntSLList::deleteFromHead(){
}

Names in c++ are always case sensitive.

zipcodeman