473,378 Members | 1,422 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Const String with special character

Hello,

Is it possible to have a constant String initialised with special character
like that = (Char)0x02 + "CMD" + (Char)0x03

?

Thx

Apr 19 '06 #1
2 2533
Geoffrey wrote:
Is it possible to have a constant String initialised with special character
like that = (Char)0x02 + "CMD" + (Char)0x03


Yes. Use the unicode escape sequence:

const string Foo = "\u0002CMD\u0003";

Jon

Apr 19 '06 #2
VJ
No...

"Geoffrey" <AE**************@dufour.be> wrote in message
news:OZ**************@TK2MSFTNGP05.phx.gbl...
Hello,

Is it possible to have a constant String initialised with special
character
like that = (Char)0x02 + "CMD" + (Char)0x03

?

Thx


Apr 19 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Mark | last post by:
Hi, My page has a table with many columns such that the right-side of the table gets chopped off when printed. I specify a table width of 100%, but otherwise no cell dimensions are specified. ...
6
by: Sona | last post by:
Hi, What's the advantage/disadvantage of using a "const char*" over a "char*" ? I read some place that char* are string literals that on some machines are stored in a read only memory and cannot...
7
by: al | last post by:
char s = "This string literal"; or char *s= "This string literal"; Both define a string literal. Both suppose to be read-only and not to be modified according to Standard. And both have...
8
by: andrew.fabbro | last post by:
In a different newsgroup, I was told that a function I'd written that looked like this: void myfunc (char * somestring_ptr) should instead be void myfunc (const char * somestring_ptr) ...
5
by: max | last post by:
Dear all, I did the following analysis to conclude that the following pointer types are not compatible. Please let me know If my analysis and interpretation of the C standard are correct: ...
7
by: Mark P | last post by:
The following compiles without error on four different platforms (Linux g++, Sun CC, HP aCC, Win Dev-C++) so I suspect it's ok, but I don't see why this isn't a const-related error. pB is a...
3
by: dstevel | last post by:
The signature for strtol is: strtol( const char*, char**, int) So.. if we start with a passed "const char*" (pointer to const char), then we can't create a non-const char pointer pointer to...
14
by: Shhnwz.a | last post by:
Hi, I am in confusion regarding jargons. When it is technically correct to say.. String or Character Array.in c. just give me your perspectives in this issue. Thanx in Advance.
9
by: somenath | last post by:
Hi All, I was going through one piece of code which is written by an experience programmer and it is working fine. But I think the use of "strstr" is not proper because it may show undefined...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.