foreach loop problem.

Written by kishore

Im havign an odd problem where a foreach loop that is supposed to delete all records only deletes half of the records.

foreach (Microsoft.Office.Interop.Outlook._ContactItem item in folder.Items)
{
item.Delete();
MessageBox.Show("contact gone");
}

the folder.Items is a MAPfolder ive created in outlook that has contacts inside it.

The loop will only delete half of the contacts from the folder. If I run the method twice, it then removes allof them. Why is this happening?


Go to Source

Feb
21

Help with precedence rules?

Written by kishore

OK I’m asked to solve some precedence rules problems in my c++ book and just had a quick question

first off, I’m given: 27.0+8.0/5.0-7.0. I got 21.6 because 8.0/5.0 would be 1.6 right?

The second one I’m a bit unsure about is:

int (15.0+12.0*2.2-2*7) Now I know the order in which I would perform those, but would the decimals become integers before the math is applied? For example, would the 12.0*2.2 become 24, since the 2.2 would simply become 2, or would it still be 26.4, and then you’d round THAT down to 26? Or do you do all the math, and only make the final answer an integer?


Go to Source

Feb
21