Re: delete map elements
David wrote:
[snip]
Sorry I forget the function AddMyclass();
void test::AddMyclass(const string &myname,const myclass &st)
{
map<string,myclass*>:;iterator ii;
^
That should be a ":", right? Also, ii is not used further down the code.
myclass *newmyclass=NULL;
newmyclass=new myclass(st);
That can be combined into:
myclass * newmyclass = new myclass ( st );
tests[myname]=newmyclass;
}
This is most definitely not the code that you use in your program. For one
thing, it does not compile. Please post the actual code that demonstrates
the problem. Make it a complete, but small program that others can just cut
and paste. You want to make it as easy as possible for others to help you.
Best
Kai-Uwe Bux
........
( i thought i could make some change on line 18 so that i could get
the program worked as i would like it to; i am not sure if i am right)
Try this
if ( 0 == (1 & c) && 0 == (1 & r) )
cout << setw(5) << setfill(' ') << r*c;
or this
if ( 0 == (1 & (r * c)) )
cout ...
or this
if ( !(1 & (r * c)) )
cout ...
or this
if ( 0 == ((r * c) % 1) )
cout ...
Oops, I forgot to add this:
Which of the above work?
Which don't?
Why?- Hide quoted text -
- Show quoted text -
i believe first one would definetely work!!!!
Hmm, what if 'r' and 'c' are each 3?
Try (edit, compile, & execute) with each of the various
'if' statements to see which ones work.