Hi, I just posted about the linker error, and I'm having a new problem.

When I try to compile this file, I get this error:
I understand why I am getting the error, but I am unfamiliar with the string class (friend helped me write this program), and I don't really know a better way to read in the file. So I guess my question is, is there a way to read in the file that won't cause these conflicts? TIA.

g++ -o tht timingtest.cxx
timingtest.cxx: In function `void time_something1 ()':
timingtest.cxx:51: conversion from `char *' to non-scalar type
`HashableString' requested
timingtest.cxx: In function `void time_something2 ()':
timingtest.cxx:85: conversion from `char *' to non-scalar type
`HashableString' requested
timingtest.cxx: In function `int main (int, char **)':
timingtest.cxx:128: conversion from `char *' to non-scalar type
`HashableString' requested


#include <iostream.h>
#include <stdio.h>
#include <stdlib.h>
#include <string>
using namespace std;
// for clock_t type, clock() timing function, and CLOCKS_PER_SEC
#include <time.h>
#include "HashTable.h"
#include "HashableString.h"

// creating two Hashtables, with sizes 1 and 10

HashTable<HashableString> ht1(1);
HashTable<HashableString> ht10(10);

string filename;

// This function demonstrates one way to time an algorithm, namely by
// using the clock() function from time.h. The man page for clock(),
// which is viewable by running "man clock", says "the clock()
// function returns the amount of CPU time (in microseconds) used
// since the first call to clock() in the calling process."
void time_something1()
{
// "clock_t" is some integer type defined in time.h by a line like
// "typedef long clock_t;".
clock_t start = clock();

FILE* fp = NULL;

fp = fopen(filename.c_str(), "r");

char line[512];
char* tmp;

if(fp)
{
while(fgets(line, 512, fp))
{
tmp = strtok(line, " ");

HashableString h = tmp;
ht1.search(h);
}

fclose(fp);
}

clock_t finish = clock();

std::cout << endl << "Hello from time_something1(). Elapsed time is "
<< (finish - start) / double(CLOCKS_PER_SEC)
<< " seconds." << endl;
}


void time_something2()
{
// "clock_t" is some integer type defined in time.h by a line like
// "typedef long clock_t;".
clock_t start = clock();

FILE* fp = NULL;

fp = fopen(filename.c_str(), "r");

char line[512];
char* tmp;

if(fp)
{
while(fgets(line, 512, fp))
{
tmp = strtok(line, " ");

HashableString h = tmp;
ht10.search(h);
}

fclose(fp);
}

clock_t finish = clock();

std::cout << endl << "Hello from time_something2(). Elapsed time is "
<< (finish - start) / double(CLOCKS_PER_SEC)
<< " seconds." << endl;
}



int main(int argc, char *argv[])
{
if(argc != 3)
{
std::cout << argv[0] << " <filename> time|print" << endl;
return 1;
}

filename = argv[1];

FILE* fp = NULL;

//read the file specified in the command line

fp = fopen(filename.c_str(), "r");

char line[512];
char* tmp;

if(fp)
{
// get each line into a buffer
while(fgets(line, 512, fp))
{
tmp = strtok(line, " ");

// get a token and add it to both hash tables
HashableString h = tmp;
ht1.search_and_insert(h);
ht10.search_and_insert(h);
}

fclose(fp);
}


// if commandline param is print, then print the hashtables
if(strcmp(argv[2], "print") == 0)
{
ht1.debug_print();
ht10.debug_print();
}
// if commandline param is time, then search using every word in the file
else if(strcmp(argv[2], "time") == 0)
{
time_something1();
time_something2();
}
else
{
std::cout << argv[0] << "<filename> time|print" << endl;

}

return EXIT_SUCCESS;
}