Search code examples
serial-portc++-clixor.net

What is the purpose of the bitwise XOR operator in this C++ application?


I'm using System::IO::Ports for a project that requires sending data over a serial port and I'm not sure why the "^" operator is being used on my data types.

For instance, take this code snippet:

SerialPort^ serialPort = gcnew SerialPort();

array<String^>^ serialPorts = SerialPort::GetPortNames();

Now what exactly is the purpose of the caret operator here? I know what an exclusive or operation is, but I don't see how it applies in this instance. What are the strings being XOR'd with?

I tried to search for the answer to this, but every answer deals with a description of what XOR logic is, not how it's used in a circumstance like this.

The code works, I'm just asking from a curiosity standpoint. If anyone happens to know the answer, throw me a reply and I'll give you a mad high-five


Solution

  • This is NOT XOR. Its Microsofts spin on C++(C++/CLI). The String^ represents system::string which is different than std::string.