GIDForums  

Go Back   GIDForums > Computer Programming Forums > C++ Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 06-Dec-2003, 11:51
danielxs66 danielxs66 is offline
New Member
 
Join Date: Dec 2003
Posts: 2
danielxs66 is an unknown quantity at this point
Unhappy

Simple thing, but how do I get this */& thing working


Hi,

little help needed here.

I have a function:

Code:
saveData(const vector<MyClass*> &items,const char* filename);

I use const along with & to avoid copy constructor usage.

Now, in the calling program I have a vector:
Code:
vector<MyClass*> items;

...um, how do I call the function?
if I use:
Code:
filecontroller->saveData(items, datafile);
the compiler says:
Code:
passing `const FileController as `this' argument of `bool FileController ::saveData(std::vector<MyClass*, std::allocator<MyClass*> >&, const char*)' discards qualifiers

How do I call the function correctly?

Regards,

daniel
 
 

Recent GIDBlogMeeting the local Iraqis by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 11:29.


vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.