Click here to Skip to main content
15,793,452 members
Please Sign up or sign in to vote.
2.33/5 (3 votes)
See more:
hello,

I want to convert code from delphi to C#
i want to fill the structure object with ' ' i.e 32 in C#

FillChar(mystructobj,sizeof(mystruct),' ') ;
Posted

1 solution

Try:
string s = new string(' ', 20);


Good luck!
 
Share this answer
 
Comments
Member 4354249 5-Jun-12 3:07am    
but what i have is a structure object. i want all the fields of structure object to be assigned with (' ') char
E.F. Nijboer 8-Jun-12 17:20pm    
This normally isn't possible, but check the links if you want to dive in:
http://www.developerfusion.com/article/84519/mastering-structs-in-c/
http://geekswithblogs.net/taylorrich/archive/2006/08/21/88665.aspx

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900