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.

to convert integer value into character in C.

Status
Not open for further replies.

zamanmalik

Junior Member level 2
Joined
Jun 18, 2008
Messages
23
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,429
integer value of character 3 in c

to convert integer value into character in C?
 

convert char to int c

for CCSC
Syntax:
string = itoa(i32value, i8base, string)

Parameters:
i32value is a 32 bit int
i8base is a 8 bit int
string is a pointer to a null terminated string of characters

Returns:
string is a pointer to a null terminated string of characters


Function:
Converts the signed int32 to a string according to the provided base and returns the converted value if any. If the result cannot be represented, the function will return 0.


Requires:
#inlcude<stdlib.h>



Examples:
int32 x=1234;
char string[5];

itoa(x,10, string);

// string is now “1234”



or for int to char

int a = 3;
char c;
c = a + '0'; = 33 hex '0' = 30 hex
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top