Click here to Skip to main content
15,868,016 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Please help me regarding :LoadCursorFromFile with .ani file Pin
Stuart Dootson26-May-09 0:51
professionalStuart Dootson26-May-09 0:51 
GeneralRe: Please help me regarding :LoadCursorFromFile with .ani file Pin
ptr_Electron26-May-09 1:09
ptr_Electron26-May-09 1:09 
GeneralRe: Please help me regarding :LoadCursorFromFile with .ani file Pin
Stuart Dootson26-May-09 2:24
professionalStuart Dootson26-May-09 2:24 
GeneralRe: Please help me regarding :LoadCursorFromFile with .ani file Pin
ptr_Electron26-May-09 2:26
ptr_Electron26-May-09 2:26 
GeneralRe: Please help me regarding :LoadCursorFromFile with .ani file Pin
ptr_Electron26-May-09 21:46
ptr_Electron26-May-09 21:46 
GeneralRe: Please help me regarding :LoadCursorFromFile with .ani file Pin
Stuart Dootson26-May-09 21:49
professionalStuart Dootson26-May-09 21:49 
QuestionRe: Please help me regarding :LoadCursorFromFile with .ani file Pin
David Crow26-May-09 3:09
David Crow26-May-09 3:09 
QuestionOperator [] Overloading Pin
Mikey_H25-May-09 22:19
Mikey_H25-May-09 22:19 
I have made a few wrapper classes for arrays to include dynamic resizing, string indexing etc.
The classes worked fine when used on their own in an app. Now i have attempted to make a Hashtable class which uses an Array object of AssocArray objects.

When I attempt to access data by using code like ' array[x][str] = y; ' I get the following error...
error C2679: binary '[' : no operator found which takes a right-hand operand of type 'std::string' (or there is no acceptable conversion)

#include <string>
using std::string;

int x = 0;
int y = 1;

string = "Foo";

array = new Array<AssocArray<int>>();

// Error C2679
array[x][str] = y;


Function for overloaded operators is very similar for both Array, and AssocArray. I have removed all code inside function as it produced the same error when commented out.

template <class TType>
TType& AssocArray<TType>::operator [](string s)
{
	return new TType;
}


It is my understanding that the line ' array[x][str] = y; ' would be computed like this...
AssocArray<int> ax = array[x];
ax[str] = y;

Am I correct about this?

I'm not sure what is going on here, and assume this is all the relevant code, If you would like to see any more just ask.
AnswerRe: Operator [] Overloading Pin
CPallini25-May-09 22:43
mveCPallini25-May-09 22:43 
GeneralRe: Operator [] Overloading Pin
Mikey_H25-May-09 23:19
Mikey_H25-May-09 23:19 
AnswerRe: Operator [] Overloading Pin
Stuart Dootson25-May-09 22:49
professionalStuart Dootson25-May-09 22:49 
GeneralRe: Operator [] Overloading [modified] Pin
Mikey_H25-May-09 23:17
Mikey_H25-May-09 23:17 
GeneralRe: Operator [] Overloading Pin
Stuart Dootson25-May-09 23:35
professionalStuart Dootson25-May-09 23:35 
GeneralRe: Operator [] Overloading Pin
Mikey_H26-May-09 0:35
Mikey_H26-May-09 0:35 
AnswerRe: Operator [] Overloading Pin
Cedric Moonen25-May-09 23:31
Cedric Moonen25-May-09 23:31 
GeneralRe: Operator [] Overloading Pin
Mikey_H26-May-09 0:36
Mikey_H26-May-09 0:36 
QuestionDoes anyone know about "MSUIM.Msg.Private"? Pin
fitatc25-May-09 22:00
fitatc25-May-09 22:00 
QuestionVC++ 6.0 + Processor Pack + Service Pack 5 cause stack overflow ? Pin
felixfan81925-May-09 21:57
felixfan81925-May-09 21:57 
QuestionHow to handle time delays Pin
V K 225-May-09 20:32
V K 225-May-09 20:32 
AnswerRe: How to handle time delays Pin
CPallini25-May-09 20:45
mveCPallini25-May-09 20:45 
AnswerRe: How to handle time delays Pin
Rajesh R Subramanian25-May-09 20:53
professionalRajesh R Subramanian25-May-09 20:53 
GeneralRe: How to handle time delays Pin
V K 225-May-09 20:54
V K 225-May-09 20:54 
GeneralRe: How to handle time delays Pin
CPallini25-May-09 20:59
mveCPallini25-May-09 20:59 
QuestionHelp on dynamic memory allocation and deallocation Pin
pani6825-May-09 20:08
pani6825-May-09 20:08 
AnswerRe: Help on dynamic memory allocation and deallocation Pin
«_Superman_»25-May-09 20:22
professional«_Superman_»25-May-09 20:22 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.