ARM Technical Support Knowledge Articles

WRONG RESULT IN STRING ESCAPE SEQUENCES

Applies to: General Topics

Answer


Information in this article applies to:


QUESTION

In my C source code I am using special characters in strings.

For example:

string1[ ] = "Franx07ais"

I expected that this would result in the word Français. However, it appears that the Compiler uses 0x7A since the result is just Franzis.

Is this a known bug?

ANSWER

This is a standard ANSI behaviour. To get what you expect you need to break strings at the Escape Sequences. The expected result is generated when you write:

string1[ ] = "Fran" "x07" "ais"

MORE INFORMATION

SEE ALSO

Article last edited on: 2004-12-13 12:25:19

Rate this article

[Bad]
|
|
[Good]
Disagree? Move your mouse over the bar and click

Did you find this article helpful? Yes No

How can we improve this article?

Link to this article
Copyright © 2011 ARM Limited. All rights reserved. External (Open), Non-Confidential