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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

compile problem

Status
Not open for further replies.

joeGrammar

Programmer
Jun 4, 2001
162
CA
I'm getting these errors:

area\rel2\batch\ice\badcall.cpp(15) : error C2143: syntax error : missing ';' before '->'
c:\temp\apps\brp_dev_area\rel2\batch\ice\badcall.cpp(15) : error C2501: 'DynEle' : missing storage-class or type specifiers
c:\temp\apps\brp_dev_area\rel2\batch\ice\badcall.cpp(15) : error C2040: 'DynEle' : 'int' differs in levels of indirection from 'class DynArray<class Temp> *'
c:\temp\apps\brp_dev_area\rel2\batch\ice\badcall.cpp(15) : error C2143: syntax error : missing ';' before '->'
Error executing cl.exe.

The code is such:
badcall.cpp

#include <stdlib.h>
#include &quot;qsort.hpp&quot;

class Temp
{
};

DynArray <Temp> *DynEle;

int tester = 1;

DynEle->SortElements(tester);

int main(){ return -1;}

and qsort.hpp(class section):

template <class T>
class DynArray : public vector<T*>
{
public:
typedef const T* TCPtr;


public:
// DynArray(t_index lNbElem) { vector<T*>::reserve(lNbElem); };
DynArray() {cout << &quot;constructed&quot;;};
~DynArray() {};



public:

void SortElements( int (*fCmp)( const TCPtr *ppe1, const TCPtr *ppe2 ) )
{
sort( vector<T*>::begin(), vector<T*>::end(),
qsort2sort(STD_NAMESPACE ptr_fun(fCmp)) );
}

void SortElements( int (*cmp)( const void *e1, const void *e2 ) )
{
SortElements( reinterpret_cast<int (*)( const TCPtr *ppe1, const TCPtr *ppe2 )>(cmp));
}
};


Anyhoo any help would be appreciated
 
#include <iamanidiot.h>

sorry, <cough> the uh.. um.. function call is uh.. supposed to be uh.. in main.. <cough>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top