Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cstdio>
- #include <cstring>
- #include <cctype>
- using namespace std;
- void chane(string *x){
- x[0] = '1';
- }
- int main() {
- string name = "apel";
- chane(&name);
- cout<<name;
- //find locaation
- int loc = name.find("x");
- //substring
- string name2 = name.substr(0,2);
- int len = name.size();
- /*input full string*/
- /*getline(cin,name);
- name +="xxzzxxxx";
- cout<<name;*/
- /*string compare*/
- //cout<< name.compare("Apel");
- //name.clear();
- /*Character array*/
- /*
- int x[100] = {1,2,33,3,4};
- char a[100],b[100],c[100];
- cin>>a;
- cout<<a<<endl;
- cin>>b;
- cout<<b<<endl;
- cin>>c;
- cout<<c<<endl;
- */
- /*
- char d[100],e[100];
- cin>>d;
- int i=0;
- while(d[i] !='\0'){
- cout<<d[i];
- e[i] = d[i];
- i++;
- }
- cout<<endl;
- e[i] = '\0';
- i =0;
- while(e[i] !='\0'){
- cout<<e[i];
- i++;
- }
- */
- /*
- string name3,name4,name5;
- cin>>name3;
- cout<<name3<<endl;
- cin>>name4;
- cout<<name4<<endl;
- cin>>name5;
- cout<<name5<<endl;
- */
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement