CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 15 of 16

Thread: Pointer Problem

Threaded View

  1. #7
    Join Date
    Sep 2009
    Posts
    7

    Re: Pointer Problem

    So here is more info:


    Functions.Cpp:

    Code:
    #include "stdafx.h"
    #include <sstream>
    
    
    void reader(string data, Binary binarys[], Constant constants[], int *binaryid, int *constantid)
    {
    	cout << "Reader";
    
    	int cpri = 0; //CURRENT
    	int hpri = 0; //RIGHT NOW
    	bool done = false;
    	
    
    	while(done == false){
    		if(binarys[*binaryid].ExpressionPointer1 == NULL)
    			next(data,binarys,constants,binaryid,constantid, &cpri, &hpri);
    		else if(binarys[*binaryid].ExpressionPointer2 == NULL)
    			done = true;
    		else{//IF BOTH NULL
    			cout << "NONE";
    		}
    	}
    }

    Binary Expression.h:

    Code:
    #include <string>
    using std::string;
    using namespace std;
    
    class Binary : public Expression{
    public:
    	string s_operator;
    	Expression *ExpressionPointer1;
    	Expression *ExpressionPointer2;
    };

    Constant Expression.h:

    Code:
    class Constant : public Expression{
    public:
    	int number;
    };
    Expression.h:

    Code:
    #include <string>
    using std::string;
    using namespace std;
    
    class Expression{
    public:
    
    };

    ExpressionParser.cpp:

    Code:
    int _tmain(int argc, _TCHAR* argv[])
    {
    	string data;
    	fstream filestr;
    
    	int binaryid   = 0;
    	int constantid = 0;
    	Constant constants[99];
    	Binary binarys[99];
    ......
            reader(data,binarys,constants,&binaryid,&constantid);
    .......
    }

    ERROR:
    Code:
    1>------ Build started: Project: ExpressionParser, Configuration: Debug Win32 ------
    1>Compiling...
    1>Functions.cpp
    1>c:\users\christer\desktop\projects\expressionparser\expressionparser\functions.cpp(15) : error C2784: 'bool std::operator ==(const std::basic_string<_Elem,_Traits,_Alloc> &,const _Elem *)' : could not deduce template argument for 'const std::basic_string<_Elem,_Traits,_Alloc> &' from 'Expression'
    1>        c:\program files\microsoft visual studio 9.0\vc\include\string(90) : see declaration of 'std::operator =='
    1>c:\users\christer\desktop\projects\expressionparser\expressionparser\functions.cpp(15) : error C2784: 'bool std::operator ==(const _Elem *,const std::basic_string<_Elem,_Traits,_Alloc> &)' : could not deduce template argument for 'const _Elem *' from 'Expression'
    1>        c:\program files\microsoft visual studio 9.0\vc\include\string(80) : see declaration of 'std::operator =='
    1>c:\users\christer\desktop\projects\expressionparser\expressionparser\functions.cpp(15) : error C2784: 'bool std::operator ==(const std::basic_string<_Elem,_Traits,_Alloc> &,const std::basic_string<_Elem,_Traits,_Alloc> &)' : could not deduce template argument for 'const std::basic_string<_Elem,_Traits,_Alloc> &' from 'Expression'
    1>        c:\program files\microsoft visual studio 9.0\vc\include\string(70) : see declaration of 'std::operator =='
    1>c:\users\christer\desktop\projects\expressionparser\expressionparser\functions.cpp(15) : error C2784: 'bool std::operator ==(const std::istreambuf_iterator<_Elem,_Traits> &,const std::istreambuf_iterator<_Elem,_Traits> &)' : could not deduce template argument for 'const std::istreambuf_iterator<_Elem,_Traits> &' from 'Expression'
    1>        c:\program files\microsoft visual studio 9.0\vc\include\streambuf(548) : see declaration of 'std::operator =='
    1>c:\users\christer\desktop\projects\expressionparser\expressionparser\functions.cpp(15) : error C2784: 'bool std::operator ==(const std::allocator<_Ty> &,const std::allocator<_Other> &) throw()' : could not deduce template argument for 'const std::allocator<_Ty> &' from 'Expression'
    1>        c:\program files\microsoft visual studio 9.0\vc\include\xmemory(173) : see declaration of 'std::operator =='
    1>c:\users\christer\desktop\projects\expressionparser\expressionparser\functions.cpp(15) : error C2784: 'bool std::operator ==(const std::reverse_iterator<_RanIt> &,const std::reverse_iterator<_RanIt2> &)' : could not deduce template argument for 'const std::reverse_iterator<_RanIt> &' from 'Expression'
    1>        c:\program files\microsoft visual studio 9.0\vc\include\xutility(2246) : see declaration of 'std::operator =='
    1>c:\users\christer\desktop\projects\expressionparser\expressionparser\functions.cpp(15) : error C2784: 'bool std::operator ==(const std::_Revranit<_RanIt,_Base> &,const std::_Revranit<_RanIt2,_Base2> &)' : could not deduce template argument for 'const std::_Revranit<_RanIt,_Base> &' from 'Expression'
    1>        c:\program files\microsoft visual studio 9.0\vc\include\xutility(2050) : see declaration of 'std::operator =='
    1>c:\users\christer\desktop\projects\expressionparser\expressionparser\functions.cpp(15) : error C2784: 'bool std::operator ==(const std::pair<_Ty1,_Ty2> &,const std::pair<_Ty1,_Ty2> &)' : could not deduce template argument for 'const std::pair<_Ty1,_Ty2> &' from 'Expression'
    1>        c:\program files\microsoft visual studio 9.0\vc\include\utility(83) : see declaration of 'std::operator =='
    1>c:\users\christer\desktop\projects\expressionparser\expressionparser\functions.cpp(15) : error C2676: binary '==' : 'Expression' does not define this operator or a conversion to a type acceptable to the predefined operator
    1>Build log was saved at "file://c:\Users\Christer\Desktop\Projects\ExpressionParser\ExpressionParser\Debug\BuildLog.htm"
    1>ExpressionParser - 9 error(s), 0 warning(s)
    ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
    Last edited by Holloweye; September 2nd, 2009 at 12:03 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured