Hi again guys. Well i need to convert char to int my problem is how can i get the exact value of int if for ex:

char x=2;

i need to convert that to integer.

Recommended Answers

All 4 Replies

Conversion is not necessary. The char data type is a one-byte integer.

char x = 2;
int y = x;

The compiler will promote the char to int during the assignment.

also we can use the function of convert char to integer. also we can use Pointer in it.

>>also we can use the function of convert char to integer.

Please name that function. There is no standard C function because its not needed.

int y=(int)x;
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.