How can I convert char* to a char value?
can someone reply me asap

Recommended Answers

You probably have something like:

char str[] = "hello";
char ch= str;

Then : no. str is an array of chars, so it won't fit in one char.

you could do ch = str[0] What are you trying to do? Could you post some code?

Jump to Post

All 3 Replies

You probably have something like:

char str[] = "hello";
char ch= str;

Then : no. str is an array of chars, so it won't fit in one char.

you could do ch = str[0] What are you trying to do? Could you post some code?

to convert it make it (&char)

How can I convert char* to a char value?
can someone reply me asap

No you cannot convert , are you looking for something like this ?

char *a="hellp";
char b = *a ;
Be a part of the DaniWeb community

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