![]() |
C/C++, KDEVELOP |
|---|
BasicsProgram FlowFunctionsClasses and ObjectsX WindowKDevelop----------------- © Alfred Nussbaumer Updated: 09 December 2021 ----------------- |
Simple TypesThere are several simple data types in C++:
Type CastingThe general form of a type cast is (type) expression. For example, (char) 65forces the expression to be a character type, so the result is "A".
#include <iostream.h>
int alphabet();
int main() {
alphabet();
return 0;
}
int alphabet() {
for (int i=65;i<=90;i++) cout << (char) i;
cout << endl;
return 0;
}
ABCDEFGHIJKLMNOPQRSTUVWXYZ |