Computer problems,Computer help
*AX SOFT>>>Programming & Design

How to converts ASCII values to characters in C language ?


How to converts ASCII values to characters in C language ?

its very simple u can achieve that goal by two ways

1) by printf function "%c"
2) by typecasting

i m explaining both of them

method 1

#include<stdio.h>
#include<conio.h>
void main()
{
int asciiVal=65;
//this will print the character value of that number (ASCII)
printf("%c",asciiVal);

}

Method 2

#include<stdio.h>
#include<conio.h>
void main()
{
int asciiVal=65;
//typecasting to character
char cVal=(char)asciiVal;
printf("%c",cVal);
//however its nearly same
}

in last please rank my answer
bye

see if u have
int x = 65;
u can do this:

char c = x; // same as c = 'a';

or u can do this if u need to print a character:

printf( "%c", x);

printf("%c",65);

this will display 'A'. ie. the corresponding ascii char.

similarly u can find the ascii of unknow char like '\n'

eg,
printf("%d",'\n');

Tags
  General - Computers & Internet   Software   Security   Programming & Design   Facebook   Flickr   Google   MSN   MySpace
Related information
  • Can External CSS Style Sheets Pose a Security Risk?

    Well, basically everything can be a security risk.... but you probably know that. External Style Sheets can pose security threats to a websites user; less commonly the remote server. They can be...

  • Is there a Firefox add on to make it render type nicely like Safari?

    not now, maby someone will make it ? i dont know, but i like safari it looks nice

    ...
  • How do you remove the box around flash files on websites?

    The border that appears around activeX objects is a bug in IE only. (It does not appear on other browsers) To remove it: Insert the following script JUST AFTER the last line of your last embedde...

  • I need help finding a Web site?

    If you want to download Google's Picasa, it has awesome features to make collages, and Polaroid-like photo stackers, etc... It's pretty cool. ...

  • How in HTML or Javascript do you replace text in a table with different text?

    Let's say you have a very simple table: <table> <tr> <td id="TheMessage">Hello!</td> </tr> </table> And then your button: <input t...

  • Php session issues?

    First, check your web server logs for error. Make sure php error reporting is on. Whenever you get a blank page, you've got an error. Are you calling session_start(); at the top of each o...

  • RefactorIT refactoring Java Source Code?

    Refactoring code is something a human should do using an IDE. One analysis tool I enjoy is PMD. It runs a bunch of (configurable and extendable) rules and reports a list of things it sees. Sev...

  • How do i get a FONT like this in this image?

    Here is the website to download that font. ...

  •  

    Categories--Copyright/IP Policy--Contact Webmaster