//
// main.cpp
// cpplearn1
//
// Created by myhaspl on 2017/12/3.
// Copyright © 2017年 myhaspl@myhaspl.com. All rights reserved.
//
#include <iostream>
using namespace std;
int main(int argc, const char * argv[]) {
// insert code here...
//cin以空格、TAB、回车为结束输入
string x="hello" "world";
char y1[20];
char y2[15]="hello,world!";
char y3[32];
cout<<"input a string=>y1:";
cin>>y1;
cout<<"input a string=>y3:";
cin>>y3;
cout<<x<<endl;
cout<<y1<<endl;
cout<<y2<<endl;
cout<<y3<<endl;
cout<<strlen(y1)<<endl;
cout<<sizeof(y1)<<endl;
return 0;
}
input a string=>y1:location
input a string=>y3:my book
helloworld
location
hello,world!
my
8
20
Program ended with exit code: 0