cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
General C++ Programming
string to char ( but not char* )
string to char ( but not char* )
Oct 16, 2014 at 9:42pm UTC
dipak99
(11)
if string contains 0xAB hex value, how can i store it in char array (at one of the location ) such that char[specific location] contains 0xAB as it is.
Last edited on
Oct 16, 2014 at 9:43pm UTC
Oct 16, 2014 at 9:57pm UTC
helios
(17574)
array[dst_index] = string[src_index];
Oct 16, 2014 at 10:20pm UTC
dipak99
(11)
string s_low = 0xAB;
unsigned char ch;
ch = s_low; --> error: cannot convert 'std::string {aka std::basic_string<char>}' to 'unsigned char' in assignment
Last edited on
Oct 16, 2014 at 10:23pm UTC
Oct 16, 2014 at 11:06pm UTC
helios
(17574)
Interesting how what you wrote looks nothing like what I wrote.
Oct 16, 2014 at 11:12pm UTC
keskiverto
(10402)
Perhaps
http://www.cplusplus.com/reference/string/stoi/
Oct 17, 2014 at 6:00am UTC
MiiNiPaa
(8886)
if string contains 0xAB hex value
How? does it contain four characters
'0
'x'
'A'
'B'
? Or its first character has value of 0xAB?
Topic archived. No new replies allowed.