String Character Changing
#2

When you use input[i] it returns the entire string from that point onwards. For example:
pawn Код:
new input[6] = "hello";
printf("%s", input[1]);
//prints: ello
The proper way to compare a single character would be:
pawn Код:
if(input[i] == 'A')
Note: single quotes.
But you may want to look at an implementation of rot13 or similar; 26 similar lines does not seem efficient at all.
Reply


Messages In This Thread
String Character Changing - by Aerotactics - 03.06.2014, 23:20
Re: String Character Changing - by Vince - 03.06.2014, 23:27
Re: String Character Changing - by Aerotactics - 03.06.2014, 23:38

Forum Jump:


Users browsing this thread: 1 Guest(s)