Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <iostream>
- #include <string>
- #include <string.h>
- using namespace std;
- string s_1 = "SONY";
- ////////////////////////////////////////////////////////////////////
- int main() //
- {
- for(int i = 0; i < 4; i++)
- {
- cout << s_1[i] << ", ";
- }
- }
- /*
- #include <stdio.h>
- #include <iostream>
- //#include <string>
- #include <string.h>
- using namespace std;
- string s_1 = "SONY";
- char sz_1[73] = "_Pictures.";
- ////////////////////////////////////////////////////////////////////
- int main() //
- {
- s_1 += sz_1;
- cout << "1: " << s_1 << endl;
- printf("The length of \"str_1\" = %d \n", s_1.length());
- strcpy(sz_1, s_1.c_str());
- printf( "2: %s \n", sz_1);
- return 0;
- }
- */
- /*
- #include <iostream>
- #include <stdio.h>
- using namespace std;
- ///////////////////////////////////////////////////
- int main() //
- {
- string s1 = "SONY ";
- string s2 = "Pictures";
- string s3 = s1;
- cout << s1 << "\n";
- cout << s2 << '\n';
- cout << s3 << endl;
- }
- */
- /*
- #include <iostream>
- #include <stdio.h>
- using namespace std;
- ///////////////////////////////////////////////////
- int main() //
- {
- string s1 = "SONY";
- string s2 = "Pictures";
- string s3 = "United States of America";
- cout << s1 << "\n";
- cout << s2 << '\n';
- cout << s3 << endl;
- }
- */
- /*
- #include <stdio.h>
- int main()
- {
- int n,
- n_1 = 5, // 101
- n_2 = 4; // 100
- // 111 |
- // 100
- //1)n = n_1 && n_2;
- n = n_1 & n_2;
- //3)n = n_1 || n_2;
- printf(" n = %d", n);
- }
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement