locked
How use Platform::String iterators. C++/CX

    Question

  • Giving _number1 is a TextBox in a XAML UI, the code:

    for (const char16 *it = begin(_number1->Text); it != end(_number1->Text); it++)
        {
        c = *it;    
        }
    
     

    doesn't work, because function begin() and end() work on different variable. ( I inspect the code with debugger and I find different addresses).

    If I use a new String variable like this:

    String^ st = _number1->Text;	
    and I loop on "st" the code works.

    Can you help me ?

    Thank you very much.

    Wednesday, September 24, 2014 8:57 AM

Answers

  • "st" works but you don't want to use it?

    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    • Marked as answer by marietto92 Thursday, September 25, 2014 9:45 PM
    Wednesday, September 24, 2014 1:14 PM
    Moderator