473,387 Members | 1,492 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,387 software developers and data experts.

declaring hexa & octadecimals data types in c++

How to declare hexa & octadecimals data types in c++
Aug 16 '07 #1
1 2241
JosAH
11,448 Expert 8TB
How to declare hexa & octadecimals data types in c++
An int is an int is an int. Ints have several *representations* to us humans, i.e.
we sometimes prefer to talk about int values in hexadecimal, octal, decimal,
binary or tally notation. C and C++ just support octal, decimal and hexadecimal
notation for us. There are even functions available that can convert strings that
represent other int notations to an int. But all ints are just ints to a computer.

So, i, j and k all have the same value here:

Expand|Select|Wrap|Line Numbers
  1. int i= 42; // decimal
  2. int j= 052; // octal
  3. int k= 0x2a; // hexadecimal
  4.  
and they all have the same int type.

kind regards,

Jos
Aug 16 '07 #2

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

Similar topics

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...
4
by: google | last post by:
I am trying to implement form that allows a user to update data in multiple records in a table based on criteria they enter in the form. Because I want to allow some user interaction on a record...
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...
2
by: [Gho] | last post by:
How to convert a Hexa value to negative and non negative value : if i get 0x1d = result should be 29 but if i get fd = result should be -3 How to do that
2
by: sarchanakumar | last post by:
Hi friends, I want to write a program to add two hexa-decimal numbers. I know there is no way of direction addtion. My logic is, first convert two hexa-numbers into decimal after that we add and...
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....
1
by: namratha | last post by:
We want to declare an array of 16 hexa decimal numbers of 8 bytes each.Like the following: 00000000_00000000 FFFFFFFF_FFFFFFFF 00000000_FFFFFFFF 0000FFFF_0000FFFF 00FF00FF_00FF00FF...
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: 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: 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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.