C++ 数据类型

C++ 数据类型
使用编程语言进行编程时,需要用到各种变量来存储各种信息。变量保留的是它所存储的值的内存位置。这意味着,当您创建一个变量时,就会在内存中保留一些空间。

您可能需要存储各种数据类型(比如字符型、宽字符型、整型、浮点型、双浮点型、布尔型等)的信息,操作系统会根据变量的数据类型,来分配内存和决定在保留内存中存储什么。

 1 #include <iostream>
 2 
 3 /* run this program using the console pauser or add your own getch, system("pause") or input loop */
 4 using namespace std;
 5 int main(int argc, char** argv) {
 6     char ch;
 7     cin >>ch;
 8     ch=(ch>='A'&&ch<='Z')?(ch+32):ch;
 9     cout <<ch<<endl;
10     return 0;
11 }

猜你喜欢

转载自www.cnblogs.com/borter/p/9400903.html