-
including an .h file
I have looked through some of the posts and understand how to include a .h file. I have my .cpp and .h file saved in the same place but when I compile I get the error that my .h file doesn't exsist??!! Any suggestions as to why this might be happening??
Code:
#include <string>
#include<iostream>
#include "avlbst.h"
using namespace std;
int item;
int main (){
cout<< "Enter the item that you would like to place in the Binary Search Tree"<< endl;
cin >> item;
while (cin ){
AVLBST.AVLInsert(item);
AVLBST.PrettyPrint();
}
return 0;
}
-
link?
i dont know what compiler yuou are using, but it is nessicary in msvc++ to link the file. to do this you do the following
* have both windows open( your .cpp and your .h )
* then go to project<<add to project<< then files, and you should see your header file there ... include it.
* to make sure they are together, click in th workspace bar below it says file view click on that and double click the project name it should drop down for ya :)
-
I am using msvc++ and I didn't link the two. Thanks very much!!!
-