Click here to Skip to main content
15,898,134 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: .NET and assembly Pin
Blake Coverett10-Oct-03 21:02
Blake Coverett10-Oct-03 21:02 
GeneralRe: .NET and assembly Pin
Beer2611-Oct-03 7:08
Beer2611-Oct-03 7:08 
GeneralRe: .NET and assembly Pin
Blake Coverett11-Oct-03 10:06
Blake Coverett11-Oct-03 10:06 
Generalhash trouble Pin
Sirrius10-Oct-03 17:27
Sirrius10-Oct-03 17:27 
GeneralRe: hash trouble Pin
ZoogieZork10-Oct-03 18:11
ZoogieZork10-Oct-03 18:11 
Questionhow to resize and reposition all the controls in a dialog Pin
pampatipraveen10-Oct-03 16:29
pampatipraveen10-Oct-03 16:29 
AnswerRe: how to resize and reposition all the controls in a dialog Pin
Ravi Bhavnani10-Oct-03 16:46
professionalRavi Bhavnani10-Oct-03 16:46 
Generalpassing parameters Pin
Sirrius10-Oct-03 14:00
Sirrius10-Oct-03 14:00 
I have a problem and need somebody to show me the light.
I am trying to pass a struct through a template class called table. I keep generating an error of c2783 and cant for the life of me figure out why or what is wrong. The code is directly from a text book. Here is the code that is generating that error.


template<class recordType>
class table
{
table()
{
size_t i;
used = 0;
for(i=0; i<CAPACITY; ++i)
data[i].key = NEVER_USED;

}


//MODIFICATION MEMBER FUNCTIONS
template<class recordType>
void insert(const recordType &entry)
{
bool already_present;
size_t index;

assert(entry.key >= 0);

//SET INDEX SO THAT DATA[INDEX] IS THE SPOT TO PLACE THE NEW ENTRY

find_index(&entry.key,already_present,index);

//IF THE KEY WASN'T ALREADY THERE, THEN FIND THE LOCATION FOR THE NEW ENTRY.
if(!already_present)
{
assert(size() < CAPACITY);
index = hash(entry.key);
while(!is_vacant(index))
index = next_index(index);
++used;
}
data[index] = entry;
}
};

struct tractor
{
int key;
};



void main()
{
table<tractor> ta;
tractor t;
t.key=44;
ta.insert(t);

}
GeneralRe: passing parameters Pin
Michael Dunn10-Oct-03 14:47
sitebuilderMichael Dunn10-Oct-03 14:47 
GeneralRe: passing parameters Pin
Sirrius10-Oct-03 15:04
Sirrius10-Oct-03 15:04 
GeneralRe: passing parameters Pin
Phil Hamer10-Oct-03 15:34
Phil Hamer10-Oct-03 15:34 
GeneralRe: passing parameters Pin
Sirrius10-Oct-03 15:52
Sirrius10-Oct-03 15:52 
GeneralMFC Application with DTML GUI Pin
blueinred10-Oct-03 13:11
blueinred10-Oct-03 13:11 
GeneralRe: MFC Application with DTML GUI Pin
Scozturk10-Oct-03 22:16
professionalScozturk10-Oct-03 22:16 
GeneralTab Ctrl!! Pin
kannada10-Oct-03 13:02
kannada10-Oct-03 13:02 
QuestionHow to create sounds Pin
Deepak Samuel10-Oct-03 13:02
Deepak Samuel10-Oct-03 13:02 
AnswerRe: How to create sounds Pin
John M. Drescher10-Oct-03 13:38
John M. Drescher10-Oct-03 13:38 
GeneralRe: How to create sounds Pin
Scozturk10-Oct-03 22:12
professionalScozturk10-Oct-03 22:12 
Generallinked list problem Pin
K. Shaffer10-Oct-03 12:09
K. Shaffer10-Oct-03 12:09 
GeneralRe: linked list problem Pin
Phil Hamer10-Oct-03 12:24
Phil Hamer10-Oct-03 12:24 
GeneralRe: linked list problem Pin
John M. Drescher10-Oct-03 13:19
John M. Drescher10-Oct-03 13:19 
GeneralOpen and Read a PS/2 port (mouse) Pin
asd175310-Oct-03 11:50
asd175310-Oct-03 11:50 
GeneralThis is not visual, nor C++ Pin
totig10-Oct-03 11:13
totig10-Oct-03 11:13 
GeneralRe: This is not visual, nor C++ Pin
ZoogieZork10-Oct-03 11:40
ZoogieZork10-Oct-03 11:40 
GeneralRe: This is not visual, nor C++ Pin
Paul Oss10-Oct-03 11:51
Paul Oss10-Oct-03 11:51 

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.