LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-30-2012, 01:42 AM   #1
Shahid nx
Member
 
Registered: Jan 2012
Posts: 46

Rep: Reputation: Disabled
Converting string to hexa?


HI all,
Please help me out. I had an array of string which
strSrc ="1. testing http
2. MenuItem
3. MenuItem
0:Back 00:MainMenu".
and now i converted it to hexa and stored in another array
strDest =" 312E2074657374696E672068747470A322E204D656E754974656DA332E204D656E754974656DA303A4261636B2030303A4D6 1696E4D656E75" .

MY problem is when i printing values of strDest using %c in for loop it is printing all the values correctly but when i use %s it is not printing anything. please how can i use these hexa values as a string.
Thanks in advance..

Last edited by Shahid nx; 10-31-2012 at 12:06 AM.
 
Old 10-30-2012, 06:49 AM   #2
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,241

Rep: Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325
Show your code
 
Old 10-30-2012, 02:18 PM   #3
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Debian sid + kde 3.5 & 4.4
Posts: 6,823

Rep: Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957
Please use ***[code][/code]*** tags around your code and data, to preserve the original formatting and to improve readability. Do not use quote tags, bolding, colors, "start/end" lines, or other creative techniques.

If you would be so kind, please edit your initial post to enclose that long line in them. It's forcing the page too wide.

Next, what language are you talking about? What is the purpose behind this? What code are you using? Give us some context here.
 
Old 10-31-2012, 12:08 AM   #4
Shahid nx
Member
 
Registered: Jan 2012
Posts: 46

Original Poster
Rep: Reputation: Disabled
Thanks divid for suggestions.. And i solved this problem
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Converting string sequence of 1's and 0's into their Hexa sequences ahzeeper Programming 7 04-27-2011 11:22 AM
Converting string to char xfceslacker Programming 2 10-20-2006 06:15 PM
converting a int to string irfanhab Programming 6 07-30-2005 10:40 PM
converting string to asterisks pantera Programming 2 09-13-2004 02:27 PM
Converting a string from /etc/passwd liguorir Linux - Software 3 04-13-2004 03:32 PM


All times are GMT -5. The time now is 07:23 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration