Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Need help in converting char to binary in c language

Status
Not open for further replies.

Chris90

Newbie level 2
Joined
May 11, 2009
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,291
char to binary c

Hi, can anyone help me on converting a char array to binary ??

For example, i have

char MESS[4] = {"1A,"};

How do i convert this char array to binary ??

I'm currently using C programming . Thanks .
 

convert char to binary c++

They are already in binary, its just a matter of interpretation.

the char '1' is hex 0x31, or binary 0011 0001
the char 'A' is hex 0x41 or binary 0100 0001
the char ',' is hex 0x2c or binary 0010 1100
etc.

your array contains MESS[0x31, 0x41, 0x2c, \0];

C is not strongly typed so unsigned int and char are interchangeable.
 

convert char to binary in c

Hi , thanks for the reply. I will try and work out the program .
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top