Sending struct in C# to server written in C++

Hi, everybody.

I have written a C++ server for receiving data of the type, struct node, using TCP.

struct node{
int id;
int data[256];
};

Now I want to write a client-side code that sends a node structures to this server. However, this client program has to be written in C#. Is the memory arrangement of struct in C# and C++ the same Could I declare the same struct in the client C# program and using MemoryStream and IFormatter to serialize the struct and send to the C++ server

Thanks.


Answer this question

Sending struct in C# to server written in C++

  • wei jia jun

    push.

  • Sending struct in C# to server written in C++