_itoa_s equivalent in c#

Hi all,
what is the _itoa_s() equivalent in c# ?
thanks.

closed account (z05DSL3A)
Take your pick:
1
2
3
4
5
string s = i.ToString();
string s = Convert.ToString(i);
string s = string.Format("{0}", i);
string s = string.Empty + i;
string s = new StringBuilder().Append(i).ToString();
Hi Grey,
thanks for sharing the sample codes, It looks simple though .
but below are the actual code that I wanted to convert in c#

char fif_ret;
char buffer[50];
CString strPlace;
strPlace = "2";
place = atoi(strPlace.GetBuffer(0));
_itoa_s(fif_ret, buffer, 2);


and I can't still understand how _itoa_s works by looking at the above code . any idea ?
closed account (z05DSL3A)
_itoa_s(fif_ret, buffer, 2); will take the integer value of fif_ret and convert it to a binary (radix 2) string in buffer.

To do a similar thing with C#, string buffer = Convert.ToString(fif_ret,2);
Topic archived. No new replies allowed.