Hi I have the following sub:
static ustr *construct_packet(int ptype, int stype, int argc, ...)
static ustr *construct_subpacket(int sptype, const char *data, int datalen, 开发者_C百科int lenbyte)
I tried the "..." in C# and it just gives me an error of "Type Expected."
I also need to send multiple construct_subpacket's into the construct_packet sub.
What would be the equivalent to these in C#?
Question 2:
I want to pass weird ASCII characters like "char(13)" the box through a string without it being replaced by "?." How do I go about doing such a thing? Or is there no way?
Thanks
static string construct_packet(int ptype, int stype, int argc, ...)
static string construct_subpacket(int sptype, string data, int datalen, int lenbyte)
Note:
You don't really have to pass datalen in C# - unlike with pointers, with strings you always know length of the string by checking the Length property on the string
If you want to pass variable number of arguments, you can use "params" keyword. All those arguments have to be the same type
精彩评论