Jump to content
  • Advertisement
Sign in to follow this  
gunner_uk2000

Checking if char array has been initalized...

This topic is 4216 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am reading in text from an XML file via MSXML2::IXMLDOMNodePtr. I wish to parse all strings that are passed in so that things such as /n are replaced with the new line character. I think I have a parsing algorithmn that should work, however it crashes before it gets there because it gets called on nodes where the text field has not been initialized. How can I tell either from the members on IXMLDOMNode, or by looking at the char array it's self if it has been initialized? It fails because strlen gets an access violation error when it's called on the text field. the text will usually hold something like this: "îþîþîþîþîþîþîþîþîþîþîþîþîþîþîþîþîþîþîþîþ" Any Ideas?

Share this post


Link to post
Share on other sites
Advertisement
If you know the maximum length of the string you could possibly check for a terminator in the string. The other option would be to actually initialise the string at the start to be "".

These are just ideas and I dont know how MSXML2 works.

Cheers

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!