0

I've found how to convert a char to its ascii value (toascii) but I want to do it the other way round!

I'm aware you can use putchar() but that doesn't really work so well for what I'm doing, or at least I'd like to find a quicker way if there is one.

Is there not a tochar or basically the opposite of toascii?

4
Contributors
3
Replies
5
Views
6 Years
Discussion Span
Last Post by bambrah jai
0

Try the code below

#include <stdio.h>

int main()
{
	int x = 67;
	fprintf(stdout, "c->%c\n", (char)x);
	fprintf(stdout, "c->%c\n", x);
	return 0;
}

Edited by gerard4143: n/a

1

What you're asking doesn't make sense.

I'm aware you can use putchar() but that doesn't really work so well for what I'm doing,

Why? Are you trying to output a character and it's outputting a flower? Maybe you need to be more explicit so we can understand what you're doing.

or at least I'd like to find a quicker way if there is one.

Huh? What's quicker than putchar() ?

Is there not a tochar or basically the opposite of toascii?

No, a function like tochar() is worthless.

A char and it's ascii value are identical. It's just two different names for the same numerical value. Like hot dog and wiener.

0

dear friend it is working good now i can show ASCII VALUES to newcomers in IT.....THANKS A LOT

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.