ansi string

  • Thread starter Thread starter Bob Grommes
  • Start date Start date
B

Bob Grommes

You most certainly do have pointers in C#, you simply have to declare an
unsafe code block to use them.

In C# though you should avoid unsafe code when possible. The string indexer
will return each character in a string, as will a foreach statement:

foreach (char c in myString) {
// do something with c
}

or:

for (int i = 0;i++;i < myString.Length) {
// do something with myString
}

--Bob
 
Hi,
how can i create an ansi string in c#(not unicode)?
How can i convert a string member lets say string str="12345" to char*
s="12345" becuse the unicode "12345" is "1020304050" and i need to cinvert
it to char* in c# but i dont have pointers in c# so what can i do???

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top