Click here to Skip to main content
15,898,222 members
Home / Discussions / C#
   

C#

 
GeneralRe: Overloading + operator Pin
Luc Pattyn30-Nov-07 4:47
sitebuilderLuc Pattyn30-Nov-07 4:47 
QuestionError-Object reference not set to an instance of an object Pin
T4AMD29-Nov-07 7:30
T4AMD29-Nov-07 7:30 
AnswerRe: Error-Object reference not set to an instance of an object Pin
Alaric_29-Nov-07 8:19
professionalAlaric_29-Nov-07 8:19 
QuestionRe: Error-Object reference not set to an instance of an object Pin
T4AMD29-Nov-07 8:33
T4AMD29-Nov-07 8:33 
AnswerRe: Error-Object reference not set to an instance of an object Pin
Luc Pattyn29-Nov-07 8:46
sitebuilderLuc Pattyn29-Nov-07 8:46 
GeneralRe: Error-Object reference not set to an instance of an object Pin
T4AMD29-Nov-07 8:55
T4AMD29-Nov-07 8:55 
Questionremoving comments from xml strings Pin
AndrusM29-Nov-07 7:29
AndrusM29-Nov-07 7:29 
AnswerRe: removing comments from xml strings Pin
Dave Kreskowiak29-Nov-07 9:27
mveDave Kreskowiak29-Nov-07 9:27 
No, it's not a bug. He's saying it should be, but that would involve changes to the compiler to add mind reading capability.

Enumerating a collection is valid only so long as the collection remains unchanged. Adding and removing items changes the collection. If either of these operations happen, the Enumerator is automatically invalid because the bounds of the enumeration are no longer known and it's also unknown if the current item even exists anymore. When this happens, the Enumerator is no longer is a known state and cannot be recovered. It's behavior is undefined.

Enumerators do do not exclusive access to the collection, so enumerating one is inherently not a thread-safe operation. The collection CAN be modified from outside the enumeration. If this happens, the enumerator is, again, invalid.

If you're going to modify a collection, you cannot use foreach. You must use a normal for statement with an index into the array of items.


A guide to posting questions on CodeProject[^]

Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic
     2006, 2007


GeneralRe: removing comments from xml strings Pin
AndrusM29-Nov-07 22:13
AndrusM29-Nov-07 22:13 
GeneralRe: removing comments from xml strings Pin
Dave Kreskowiak30-Nov-07 2:32
mveDave Kreskowiak30-Nov-07 2:32 
GeneralRe: removing comments from xml strings Pin
AndrusM30-Nov-07 3:02
AndrusM30-Nov-07 3:02 
GeneralRe: removing comments from xml strings Pin
Dave Kreskowiak30-Nov-07 16:12
mveDave Kreskowiak30-Nov-07 16:12 
GeneralRe: removing comments from xml strings Pin
AndrusM1-Dec-07 6:32
AndrusM1-Dec-07 6:32 
GeneralRe: removing comments from xml strings Pin
PIEBALDconsult1-Dec-07 8:31
mvePIEBALDconsult1-Dec-07 8:31 
GeneralRe: removing comments from xml strings Pin
Dave Kreskowiak1-Dec-07 12:41
mveDave Kreskowiak1-Dec-07 12:41 
QuestionStrange frequency readings Pin
Guybrush8629-Nov-07 7:19
Guybrush8629-Nov-07 7:19 
AnswerApply a frequency filter Pin
Ennis Ray Lynch, Jr.29-Nov-07 8:01
Ennis Ray Lynch, Jr.29-Nov-07 8:01 
AnswerRe: Strange frequency readings Pin
Luc Pattyn29-Nov-07 9:12
sitebuilderLuc Pattyn29-Nov-07 9:12 
AnswerRe: Strange frequency readings Pin
leppie29-Nov-07 9:54
leppie29-Nov-07 9:54 
GeneralRe: Strange frequency readings Pin
Luc Pattyn29-Nov-07 9:59
sitebuilderLuc Pattyn29-Nov-07 9:59 
GeneralRe: Strange frequency readings Pin
leppie29-Nov-07 10:17
leppie29-Nov-07 10:17 
GeneralRe: Strange frequency readings Pin
Luc Pattyn29-Nov-07 11:16
sitebuilderLuc Pattyn29-Nov-07 11:16 
GeneralRe: Strange frequency readings Pin
Big Daddy Farang29-Nov-07 12:26
Big Daddy Farang29-Nov-07 12:26 
Questionclickonce error Pin
arkiboys29-Nov-07 6:58
arkiboys29-Nov-07 6:58 
QuestionLINQ to SQL Question Pin
Philip Laureano29-Nov-07 5:38
Philip Laureano29-Nov-07 5:38 

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.