CPP Typcasting
CPP
Download (.zip)
#include <iostream.h> #include <conio.h>
void main() { for(int x=1; x<256; x++) //The ASCII character set is from 1 to 255 { cout<<x<<". "<<(char)x<<" "; //Note the use of the int version of x to output a number //and the use of (char) to typecast the x into a character //which outputs the ASCII character that corresponds to the //current number } getch(); }
|