473,464 Members | 1,599 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Binary to Hexa Conversion

35 New Member
hello,
how to convert binary to hexa decimal.....


thanks & regards
lokiiiii
Jun 21 '07 #1
5 2350
miller
1,089 Recognized Expert Top Contributor
Start searching here:

perldoc search "hex"

And then simply follow the links to further documentation.

- Miller
Jun 21 '07 #2
lokeshrajoria
35 New Member
hello Miller,
that was not proper solution of my problem. my problem was convert a binary digit no to hexa decimal..
eg:
Binary= 1111
Hexa = 0xf

thanks and regards
Lokiiii
Jun 22 '07 #3
lokeshrajoria
35 New Member
i have this code but i want to write without using any function....
Expand|Select|Wrap|Line Numbers
  1. print "Gimme a number in binary: ";
  2. $num = <STDIN>;
  3. chomp $num;
  4. exit unless defined $num;
  5. $num = oct($num) if $num =~ /^0/; # does both oct, bin and hex
  6. printf "%d %x %o\n", $num, $num, $num;
  7.  
Jun 22 '07 #4
KevinADC
4,059 Recognized Expert Specialist
Why don't you want to use a function? Is this school work?
Jun 22 '07 #5
lokeshrajoria
35 New Member
Why don't you want to use a function? Is this school work?

hello kelvinADC,
i know this is school work but i want to know the internal work. how they function are work....so please help me....


Thank's and Regard's
Lokiiiiiiiii
Jul 4 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Geoffrey | last post by:
I am working on a file conversion project that reads data from a one file format, reformats in and writes in out to another. The data is records of informations - names address, account...
4
by: Dany | last post by:
Hi When I open an Hexa file I have some weird char like when I open it with Notepad. I want to open it in a readeable form (ex: "FF25AB") like with Ultra edit. Thanks regards, Dany
1
by: Adam | last post by:
Hello, I'm trying to decifer the data in the table that stores the data in the binary format. All numbers are placed in varbinary fields. All I know is the MS SQL 2000 database useing collation...
3
by: Poul Møller Hansen | last post by:
I'm struggling supporting national characters of different origin in a mixed environment using PHP, Perl and Java. I have a database created with character set UTF-8, but I'm in doubt when the...
3
by: Golan | last post by:
Hello, I have a hexa file which I need to convert to decimal. I use memcpy into variables (char for one octet, short for 2 octets and int for 4 octets) and then print the value into the file by...
5
by: serrand | last post by:
Hello all, is there a way in order to write binary numbers as hexa or octal in c ? Xavier
7
by: elliotng.ee | last post by:
I have a text file that contains a header 32-bit binary. For example, the text file could be: %%This is the input text %%test.txt Date: Tue Dec 26 14:03:35 2006...
1
by: Chandra | last post by:
Hi, I have a problem related to File Reading. I have a file which contains data which is in Hexa format. I have to read that data and push it to a function which takes a parameter of type char....
2
by: Sarath | last post by:
Is it possible to make lexical_cast function to support stirngs wtih '0x' format. e.g boost::lexical_cast<unsigned char>( "0x7E" ) This formatting throws bad_lexical_cast exception. Is there...
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.