Incrementing a char variable
According to ASCII, the value of B is the value of A plus one. So, it is right to use the code
to increment a character value. E.g.,if c=A and c++. Will c have the value 'B'?
Yes.
You can simply test it ;-).
1 2 3 4 5 6
|
#include<iostream>
char a = 'A' ;
std::cout << a ;
a++ ;
std::cout << a ;
|
Topic archived. No new replies allowed.