Link to home
Start Free TrialLog in
Avatar of Brian Dumas
Brian DumasFlag for United States of America

asked on

c# How to set a fixed char array = System.String

Here is my issue. I have a struct similar to the one below that has a fixed char array. The 'fixed char'  is necessary because the structure will be in shared memory (requirement). I want to do something like what is shown below:

public struct AStruct
{
      public long  tnum;
      public fixed char   tname[64];
}

AStruct mystruct = new AStruct();

String newstr = "Something";

mystruct.tname = newstr; //this is the line I need help with

Open in new window



Thanks, Brian
ASKER CERTIFIED SOLUTION
Avatar of it_saige
it_saige
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial