is safe put this symbol "§"?? ex: strcat(s,"§");

May 7, 2011 at 2:18am
is safe put this symbol in a string char??
"§"

to use it in comparision, concatenation or searching??

thanks ^^
May 7, 2011 at 2:24am
By the strictest definition of "safe", no. If you try this, you're making quite a few assumptions:
1. What text encoding your text editor is saving the source in.
2. What encodings your compiler accepts and how they'll be handled, particularly regarding string literals.
3. What encoding the other string is in.
#2 is probably the most difficult one. To be honest, I have no idea what my regular compiler will do if I give it a source in non-ASCII. I find it far simpler to just not ask the question and handle special characters explicitly.
Last edited on May 7, 2011 at 2:27am
May 7, 2011 at 5:36am
ok, you scare me.
ill avoid all those weird characters. >.<

im using dev c++
and the other string is a char const * with a lot of weird characters like §

thanks for your help ^^

Last edited on May 7, 2011 at 5:36am
Topic archived. No new replies allowed.