473,398 Members | 2,389 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,398 software developers and data experts.

How to assign values to a UINT8 variable?

Dear All,
If I have a UINT8 variable, how can I assign it as my expected value?

UINT8 a;
a=(00001001);

?
Thank you very much.

Best regards,
Boki.
Jul 22 '05 #1
3 23133

"boki" <bo******@ms21.hinet.net> wrote in message
news:4c**************************@posting.google.c om...
Dear All,
If I have a UINT8 variable, how can I assign it as my expected value?

UINT8 a;
a=(00001001);

?


Use hexadecimal

a = 0x09;

C++ does not support binary.

john
Jul 22 '05 #2
On 10 Sep 2004 04:38:18 -0700, bo******@ms21.hinet.net (boki) wrote:
Dear All,
If I have a UINT8 variable, how can I assign it as my expected value?

UINT8 a;
The standard C++ type is unsigned char. It isn't necessarily 8 bits,
but it is on common platforms such as Windows and Linux.
a=(00001001);

?


C++ does not have binary literals. Instead the best option is to use
hex literals:

//hex
a = 0x9;
//or octal
a = 011;
//or decimal
a = 9;

Tom
Jul 22 '05 #3
John and Tom, thank you two very much.

Best regards,
Boki.
Tom Widmer <to********@hotmail.com> wrote in message news:<5b********************************@4ax.com>. ..
On 10 Sep 2004 04:38:18 -0700, bo******@ms21.hinet.net (boki) wrote:
Dear All,
If I have a UINT8 variable, how can I assign it as my expected value?

UINT8 a;


The standard C++ type is unsigned char. It isn't necessarily 8 bits,
but it is on common platforms such as Windows and Linux.
a=(00001001);

?


C++ does not have binary literals. Instead the best option is to use
hex literals:

//hex
a = 0x9;
//or octal
a = 011;
//or decimal
a = 9;

Tom

Jul 22 '05 #4

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

Similar topics

9
by: Mike | last post by:
Is there any way I can use a function to create a variable and assign a value to it? I have a Perl script that returns some LDAP information: sn=Shore givenname=Mike logintime=20041008153445Z...
4
by: Terry | last post by:
I have a number of input boxes used to display totals based on selected items for each row in a table. There are more than a few rows that are identical, except for the form field name. I have...
16
by: sneill | last post by:
How is it possible to take the value of a variable (in this case, MODE_CREATE, MODE_UPDATE, etc) and use that as an object property name? In the following example I want 'oIcon' object to have...
1
by: Matt | last post by:
All - Is there a preferred method to assign session variables in ASP.NET / VB.NET? It looks like you can do any of the following to assign values: Session.Item("Foo") = "Bar"...
2
by: Jim McGivney | last post by:
In asp 2.0 I am trying to insert a row using a detailsview control connected to an accessDataSource. I get the error message below. I am having trouble identifing which data field is causing the...
6
by: david | last post by:
I try to use "for" loop to retrieve and assign values in web form. The code is in the following. But it can not be compiled. What I want to do is: txtQ1.Text =...
3
by: Liam Mac | last post by:
Hi All, Can anyone direct me or provide advice on how I can assign a null value to a date variable in vb.net. Basically what I'm doing is that I'm looping through a recordset where I have three...
4
by: Avi | last post by:
Hi I am creating web application in which i want to assign by default values to the property which i had created my own. In that one of the property is of type color and i am unable to assign...
6
by: Don Lancaster | last post by:
I need to progrmatically do this inside a loop this.fh03.value = fixFloat (Harms, numPoints) ; with the numbers changing per an index. If I try curHvals = "03" ; // (derived from...
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: 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?
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
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...

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.