Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <stdlib.h>
- #include <time.h>
- #include <string.h>
- using namespace std;
- //https://pastebin.com/AM7CGswP
- //https://pastebin.com/SzwN5JKN
- int main()
- {
- char tab[20] = "Hello world";
- for( int i=0; i<20; i++)
- {
- cout << (int) tab[i] << "\t" << tab[i] << endl;
- }
- cout << ">" << tab << "<" << endl;
- // cout << "Podaj tekst ";
- // cin >> tab;
- int i=0;
- while ( tab[i] !='\0' ) {
- cout << tab[i];
- i++;
- }
- cout << endl;
- char tab2[20];
- cout << tab2 << endl;
- i = 0;
- while ( tab[i] != 0 )
- {
- tab2[i] = tab[i];
- i++;
- }
- tab2[i] = 0;
- cout << tab2 << endl;
- cout << "dlugosc tekstu: ";
- i=0;
- while ( tab[i] != 0 ) i++;
- cout << i << endl;
- cout << strlen(tab) << endl;
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement