473,508 Members | 2,255 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Unsigned char

Hello..

Does anyone know the C# equivalent of an unsigned char in C++?

Thanks!

Jun 7 '07 #1
4 51469
On Jun 7, 3:38 pm, hermbag...@gmail.com wrote:
Hello..

Does anyone know the C# equivalent of an unsigned char in C++?

Thanks!
unsigned char? can a char be unsigned? isnt unsigning a contextual
thing?

suppose you have the char © - its code is A9, 169 to you and me as an
unsigned byte, or -87 as a signed byte. either way, -87 or 169.. its
still A9, or 10101001 as binary.. or © as a char who cares what the
sign is?

Jun 7 '07 #2
In .NET, it is the byte class, as it has the same storage capacity as a
char does in C++.

However, byte is not the inherent character type for .NET. That would
be char. However, you should be aware that a char instance is a 16-bit
value, and not an 8-bit one, like one might expect coming from C++.

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

<he********@gmail.comwrote in message
news:11**********************@o5g2000hsb.googlegro ups.com...
Hello..

Does anyone know the C# equivalent of an unsigned char in C++?

Thanks!

Jun 7 '07 #3
he********@gmail.com wrote:
Does anyone know the C# equivalent of an unsigned char in C++?
C++ unsigned char = C# byte
C++ char = C# sbyte

Arne

Jun 8 '07 #4
cjard wrote:
On Jun 7, 3:38 pm, hermbag...@gmail.com wrote:
>Hello..

Does anyone know the C# equivalent of an unsigned char in C++?

unsigned char? can a char be unsigned? isnt unsigning a contextual
thing?
In C++ it can.
suppose you have the char © - its code is A9, 169 to you and me as an
unsigned byte, or -87 as a signed byte. either way, -87 or 169.. its
still A9, or 10101001 as binary.. or © as a char who cares what the
sign is?
If you do something that does sign extension you will see the difference.

Arne
Jun 8 '07 #5

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

Similar topics

2
10583
by: hs | last post by:
Is the following correct? void foo(int len, char* val) { .. .. .. unsigned char* string = (unsigned char*) new char ; memcpy(string, val, len); ..
10
15612
by: tinesan | last post by:
Hello fellow C programmers, I'm just learning to program with C, and I'm wondering what the difference between signed and unsigned char is. To me there seems to be no difference, and the...
4
1042
by: ravinderthakur | last post by:
hi all experts, can anybody explain me the difference between the unsigned char and char in c/c++ langugage. specifically how does this affects the c library fucntion such as strcat,strtok...
4
14952
by: cdrom205 | last post by:
static void MDString ( unsigned char *input) { MD5_CTX context; unsigned char digest; unsigned int len = sizeof(input);//strlen (const char*) md5.MD5Init (&context); md5.MD5Update...
3
41898
by: QQ | last post by:
Hello, Here is my simple program int main() { unsigned char a =0x81; char b = 0x81; printf("unsigned char = 0x%x(%d), char = 0x%x(%d)\n",a,a,b,b); printf("cast char to unsigned...
5
7767
by: Stephen Cawood | last post by:
I'm trying to use a C++ .lib from C# (I tried the Interop group will no results). I have a working wrapper DLL (I can get back simple things like int), but I'm having issues dealing with an array...
5
2830
by: ryanlee101 | last post by:
I am getting a exception error when I complie my code. The error is: - imageData 0x00000000 <Bad Ptr> type unsigned char * I think it is from when I declare some of my char variables
26
11611
by: =?gb2312?B?wNbA1rTzzOzKpg==?= | last post by:
i wrote: ----------------------------------------------------------------------- ---------------------------------------- unsigned char * p = reinterpret_cast<unsigned char *>("abcdg");...
29
9925
by: Kenzogio | last post by:
Hi, I have a struct "allmsg" and him member : unsigned char card_number; //16 allmsg.card_number
8
7561
by: KYAW KYAW OO | last post by:
Dear All, Now, I am stuck above question so long and I would like to get Red, Green and Blue as unsigned char * each from unsigned char * of 24 bit BMP Color images. e.g unsigned char *...
0
7229
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
7129
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...
1
7061
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7502
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
5637
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
3208
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
1566
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 ...
1
769
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
428
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.