Click here to Skip to main content
15,886,963 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I searched on internet and I found that to read a file xml I must use namespace System and namespace System::Xml..my code:

<pre> if (PathFileExists(t))
    {
        XmlTextReader^ reader = gcnew XmlTextReader("C:\\Elitron\\Mail\\mail_data.xml");

        while (reader->Read())
        {
            switch (reader->NodeType)
            {
            case XmlNodeType::Element: // The node is an element.
                Console::Write("<{0}", reader->Name);

                while (reader->MoveToNextAttribute()) // Read the attributes.
                    Console::Write(" {0}='{1}'", reader->Name, reader->Value);
                Console::WriteLine(">");
                break;
            case XmlNodeType::Text: //Display the text in each element.
                Console::WriteLine(reader->Value);
                break;
            case XmlNodeType::EndElement: //Display the end of the element.
                Console::Write("</{0}", reader->Name);
                Console::WriteLine(">");
                break;
            }
        }
    }





What I have tried:

but when I compile I have this error:

it isn't possible to use nullptr..I don't know why I have this error
Posted
Updated 20-Jul-23 19:24pm
Comments
Patrice T 20-Jul-23 6:56am    
The position of error is an indication.
Member 14594285 20-Jul-23 8:34am    
#if !_HAS_CXX20
_NODISCARD_FRIEND bool operator==(nullptr_t, const exception_ptr& _Rhs) noexcept {
return !_Rhs;
}

 
Share this answer
 
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900