int i = 65; char c = static_cast<char>(i); // here c stores the letter 'A'.
#include <stdio.h> int main() { const int maxItems = 10; char myArray[maxItems], curChar; int i; for (i=0; i<maxItems; i++) { curChar = i; curChar += 'a'; myArray[i] = curChar; } for (i=0; i<maxItems; i++) { printf("Item %d: '%c'\n", i, myArray[i]); } return 0; }
//all of them are valid statement char c; c=65; c=0x41; c='A'; c='A'+32; // you will get 'a' c='A'; c++; //you will get 'B'
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)