CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 9 of 9

Thread: help

  1. #1
    Join Date
    Mar 2013
    Posts
    11

    help

    hey i am using set in my code to get fields from a reader xml which are being errored out but it is storing it in ordered form(i.e it is internally sorting it) not in accordance to how the reader xml has the fields.What should i do so that it write the errored file in accordance to the reader xml.





    Thanks in advance

  2. #2
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,396

    Re: help

    Fix the errors!
    Victor Nijegorodov

  3. #3
    GCDEF is offline Elite Member Power Poster
    Join Date
    Nov 2003
    Location
    Florida
    Posts
    12,635

    Re: help

    You could start with a more coherent question. If you need ordered data, why are you using a set?

  4. #4
    Join Date
    Mar 2013
    Posts
    11

    Re: help

    then what should i use.
    I want to retrieve the data in the order it is reading the reader xml ,but set is internally sorting it, which i don't want.

    If i don't want to change the data structure is there any other way.


    Thanks

  5. #5
    GCDEF is offline Elite Member Power Poster
    Join Date
    Nov 2003
    Location
    Florida
    Posts
    12,635

    Re: help

    Quote Originally Posted by ramsavi View Post
    then what should i use.
    I want to retrieve the data in the order it is reading the reader xml ,but set is internally sorting it, which i don't want.

    If i don't want to change the data structure is there any other way.


    Thanks
    I'll ask again why you're using a set? A list is the best container to maintain order efficiently.

  6. #6
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,396

    Re: help

    Quote Originally Posted by ramsavi View Post
    then what should i use.
    I want to retrieve the data in the order it is reading the reader xml ,but set is internally sorting it, which i don't want.
    Then why set, why not the unordered_set?
    Victor Nijegorodov

  7. #7
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,396

    Re: help

    Quote Originally Posted by GCDEF View Post
    I'll ask again why you're using a set? A list is the best container to maintain order efficiently.
    I guess OP needs a container that store unique elements. Otherwise list or vector could be used.
    Victor Nijegorodov

  8. #8
    GCDEF is offline Elite Member Power Poster
    Join Date
    Nov 2003
    Location
    Florida
    Posts
    12,635

    Re: help

    Quote Originally Posted by VictorN View Post
    I guess OP needs a container that store unique elements. Otherwise list or vector could be used.
    That's possible, but so far he hasn't said that.

  9. #9
    Join Date
    Jul 2010
    Posts
    6

    Re: help

    This is the third thread all asking (essentially) the same question, with the same lack of information and descriptive title.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured