use of undefined type????


I have two classes(class A, class main). class main uses a pointer to class A and class A uses a global pointer to main. My problem is I keep getting these errors: a.h(12) : error C2027: use of undefined type ...
Posted On: Monday 26th of November 2012 12:50:27 AM Total Views:  379
View Complete with Replies

RELATED TOPICS OF C Language PROGRAMMING LANGUAGE




Re: boost::shared_ptr used in covariant return type

zade wrote: > boost::shared_ptr is good for return type when you create a new type > using pimpl idiom, but in practice, it gives me some trouble when used > for covariant return type. code like below: blah > so, ...
VIEWS ON THIS POST

278

Posted on:

Sunday 25th November 2012
View Replies!

use of template variables ?

#include template struct A { void f(){ switch(role) { case 0: case 1: printf("did match\n"); default: printf("did not match\n"); } } }; int main() { A<0> a; A<1> b; } This is a simplified representation of a C++ ...
VIEWS ON THIS POST

199

Posted on:

Sunday 25th November 2012
View Replies!

SDL_ttf bug causes segfault for weird reasons

I'm writing a small game, and I've been getting an almost pathetic bug with SDL. I've written a small wrapper (textutil.h:rtTextUtil) to make rendering easy. Now if i call it from a class defined in a header file (class.h:ClassGood), it ...
VIEWS ON THIS POST

351

Posted on:

Sunday 25th November 2012
View Replies!

Proper union use

I remember from C that you are not supposed to access different members of a union at the same time It seems to say the same thing in the C++ standard (9.5.1) "In a union, at most one of the ...
VIEWS ON THIS POST

183

Posted on:

Sunday 25th November 2012
View Replies!

How to use the iterator from base class in a derived class?

I am trying to write a class myVector based on std::vector and add only a sort method. The sort method needs to access the array stored in the base class using iterator. I have following draft code. However it never ...
VIEWS ON THIS POST

226

Posted on:

Sunday 25th November 2012
View Replies!

How to use function from dll file in C++ code?

I want to use netCDF library, and I have dll file without header file, I know what functions are in this lib, and how to use it, but how to compile project using this dll \t I use g++ compiler ...
VIEWS ON THIS POST

321

Posted on:

Sunday 25th November 2012
View Replies!

valid use of cast

I have the following: 1: template< class Sumtype, class Averagetype > 2: Averagetype Average( Sumtype* p_array, Averagetype p_count ) 3: { 4: int index; 5: Sumtype sum = 0; 6: for( index = 0; p_count > index; index++ ) 7: ...
VIEWS ON THIS POST

132

Posted on:

Sunday 25th November 2012
View Replies!

template question: preallocation for the underlying deque in user-defined queue

Heck wrote: > I borrowed N. Josuttis's code for a queue ("The C++ Standard Library", > 1999, p. 450), with which he modifies the interface to read and > discard the front element on pop() and to throw an exception ...
VIEWS ON THIS POST

297

Posted on:

Sunday 25th November 2012
View Replies!

When to use ::

I have often come across functions which start with :: but have never know exactly what this meant. Could someone please elucidate Cheers, David...
VIEWS ON THIS POST

244

Posted on:

Sunday 25th November 2012
View Replies!

template template par used for a container statistic

hi, a) what's wrong with this code it looks like allocator is the problem. the commented version works fine, but if possible i'd rather not limit myself to ublas::vector b) the version that works is slow compared to mathematica. is ...
VIEWS ON THIS POST

186

Posted on:

Sunday 25th November 2012
View Replies!

user defined conversion operator or operator overloading?

I have an host class that holds fundamental types template struct Generic{ Generic(T val= T()):mval(val){} operator T(){return mval T mval; } template Genericoperator+(const Generic& lhs,const Generic& rhs) { return Generic(lhs.mval+rhs.mval); } ...
VIEWS ON THIS POST

183

Posted on:

Sunday 25th November 2012
View Replies!

how to return 2 instances of the same user-defined class from a function

i have a class "myClass", and i want to return two instances of the same class from a function. I define an array as follows : "myClass sample[2] ;" and i initialize two instances: "myClass sample1, sample2 ;" "sample[0] ...
VIEWS ON THIS POST

186

Posted on:

Sunday 25th November 2012
View Replies!

Design Pattern Question: Why use Interfaces?

I am refactoring code. The original authors of my project performed a lot of cutting and pasting making it hell to maintain (because you have to fix the same bug in 16 different places) and it is my job to ...
VIEWS ON THIS POST

141

Posted on:

Monday 26th November 2012
View Replies!

linked links - have to use structs?

, I am very much still learning to use pointers and am now using them to implement some basic ADTs including linkedlists. I realize C++ standard includes a ton of goodies including a linkedlist template. I am attempting to implement ...
VIEWS ON THIS POST

161

Posted on:

Monday 26th November 2012
View Replies!

how to use the return value when using C# dlls in a C++ project?

hi, I am using a C# library in my C++ project. I want to make use of the classes defined in the library to do some job, and use the return value to go on other works in my project. ...
VIEWS ON THIS POST

288

Posted on:

Monday 26th November 2012
View Replies!

How to use objectiented programming.

I have been writing some large programs and games lately and I have had people advise me that I need to write more object oriented programs. I also I understand the concept and have written some small programs to understand ...
VIEWS ON THIS POST

153

Posted on:

Monday 26th November 2012
View Replies!

Can't use activex control inside Cdialog and thread

I would like to get use my activex control inside Cdialog in beginthreadex When I used Cdialog and activex control , everything is fine but when i put it inside thread (beginthreadex), it doesn't work anymore. I can use ...
VIEWS ON THIS POST

158

Posted on:

Monday 26th November 2012
View Replies!

Modifying temporary values: fundamental vs. user types

I recently noticed a subtlety in C++ rules, and I would like to understand the reason for it: this rule is the one saying that temporary values of fundamental types cannot be modified. At first sight, this makes perfect sense, ...
VIEWS ON THIS POST

164

Posted on:

Monday 26th November 2012
View Replies!

How to use typedef in nesting class?

,please look at this code. /////////////////////////////////////////////////// #include using namespace std; class A{ private: class B;// public: int out(int x){ return outB(x)->a; } B * outB(int x); private: B* root; class B{ int a; B(int init_a) :a(init_a){} friend class A; ...
VIEWS ON THIS POST

350

Posted on:

Monday 26th November 2012
View Replies!

Defect Report: Unclear which members of match_results should beused in comparison [re] (N2284).

Dear C++ committee, In "28.4 Header synopsis [re.syn]" of N2284, two template functions are declared here: // 28.10, class template match_results: // match_results comparisons template bool operator== (const match_results& m1, const match_results& ...
VIEWS ON THIS POST

511

Posted on:

Monday 26th November 2012
View Replies!