Convert data type
-
When I programed in C, I use memcpy function to change a struct to a string. Ex: struct A { int x; ... }; ... A a; char str[50]; memcpy(str,&a,sizeof(A)); ... However, when I write in C#, I also want to convert a class/struct to string but I don't. Can you help me? Thanks
-
When I programed in C, I use memcpy function to change a struct to a string. Ex: struct A { int x; ... }; ... A a; char str[50]; memcpy(str,&a,sizeof(A)); ... However, when I write in C#, I also want to convert a class/struct to string but I don't. Can you help me? Thanks
-
Thank you for your answer, but I want to convert a string to a class/struct because I write an application using Socket, Server module wrote in MFC 6.0 and client module I write in C#, data from Server send to Client are records which converted to string and pass throught metwork. Now, I want convert this data to struct/class after receive string data from server. Please help me. It very importance for me. Thanks.