Sample 4.2:string.cpp
来源:互联网 发布:淘宝快递助手在哪订购 编辑:程序博客网 时间:2024/04/28 21:01
#include<iostream>#include<cstring>int main(){ using namespace std; const int Size = 15; char name1[Size]; char name2[Szie] = "C++owboy"; cout << "Howdy! I'm " << name2; cout << "! What's your name?\n"; cin >> name1; cout << "Well, " << name1 << ", your name has "; cout << strlen(name1) << " letters and is stored\n"; cout << "in an array of " << sizeof (name1) << " bytes.\n"; cout << "Your initial is " << name1[0] << ".\n"; name2[3] = '\0'; cout << "Here are the first 3 characters of my name:"; cout << name2 << "\n"; return 0;}
- Sample 4.2:string.cpp
- Sample 2.2:carrot.cpp
- Sample 2.3:getinfo.cpp
- Sample 2.4:sqrt.cpp
- Sample 2.5:ourfunc.cpp
- Sample 2.6:convert.cpp
- Sample 3.1:limits.cpp
- Sample 3.2:exceed.cpp
- Sample 3.3:hexoct.cpp
- Sample 3.4:hexoct2.cpp
- Sample 3.5:chartype.cpp
- Sample 3.6:morechar.cpp
- Sample 3.7: bondini.cpp
- Sample 3.9:fltadd.cpp
- Sample 3.8: floatnum.cpp
- Sample 3.10:arith.cpp
- Sample 3.11:divide.cpp
- Sample 3.12:modulus.cpp
- Keil C51对C语言的关键词扩展之十八:using
- sublime text 显示中文乱码
- mysql的1067错误 - 2
- C#基础-C#数据结构,集合
- 阶乘的精确值!
- Sample 4.2:string.cpp
- 水仙花数
- linux shell基础命令
- Sample 4.3:instr1.cpp
- 允许用户输入的插入排序
- (+)2013年11月交易总结(9天)(4.54)(第一个盈利月,庆祝一下,加油!!!)
- jvm详解-概览
- Sample 4.4:instr2.cpp
- Windows 8令人担忧:8和8.1两版本份额目前仅有9.3%