0

ok so my compiler is doing something weird, for this like of code it is thinking the \d is a command like \n but that is a cstring, and it uses each char to decode a message to Attack at dawn!, but comes out missing the c, any hits or tips. char encoded[] = ":mmZ\dxZmx]Zpgy";

3
Contributors
2
Replies
3
Views
8 Years
Discussion Span
Last Post by stephen84s
1

ok so my compiler is doing something weird, for this like of code it is thinking the \d is a command like \n but that is a cstring, and it uses each char to decode a message to Attack at dawn!, but comes out missing the c, any hits or tips. char encoded[] = ":mmZ\dxZmx]Zpgy";

Missing the c? What c? I don't see a c in the string. \ is the escape character. If you want a \ to not be interpreted as an escape character, but as a character, use two of them:

char encoded[] = ":mmZ\\dxZmx]Zpgy";
Votes + Comments
Nice, traced the problem even when the O.P. wasn't at all clear with what he was trying to achieve.
0

Missing the c? What c? I don't see a c in the string. \ is the escape character. If you want a \ to not be interpreted as an escape character, but as a character, use two of them:

Yep the missing "c" was never clear at first, only when I read the post over and over I figured it **seems** like a substitution ciper, where

c = \
A = :
a = Z
t = m
<SPACE> = x .. etc

Hence the problem with the "c".

Amazing work VernonDozier, you hit the nail on the head even though you went in blind.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.