Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

bubble sort HELP!!!!!!

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
0
0
I have done all the code and this compiles why doesn't it link properly i get lnk2001 eroor-unresolved external symbol.

Please Help!!!!!


#include <time.h>
#include &quot;llist.h&quot;
#include &quot;xcept.h&quot;
template<class T>

void main(void)
{
srand((unsig#include <iostream.h>
ned int) time(0)); // seed the random number generator
int Size = 50; // set the size of the linear list
LinearList<int> L(Size);
try {
int OldInt;
// make sure the list is empty
while (!L.IsEmpty())
L.Delete(1, OldInt);
// fill the list with random numbers

for(int I = 0; I < Size; I++)
L.Insert(I, (rand() % 900 + 100));
void BubbleSort (T a[], int n)
{
for (int I= n; I > 1; I--1)
Bubble(a, I);
}
cout << &quot;List is &quot; << endl;
cout << L << endl;
}
catch (...) {
cerr << &quot;An exception has occurred&quot; << endl;
}
// show the list
 
Hard to find the reason for the linker error without the included source. Obviously you are working with templates.
Do you know that the class declaration and definition
must be in the same file when using templates? Otherwise
the code cannot be linked because the information of the used data type (size) is unknown.

-- ralf
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top