Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<string>
- #include<stdio.h>
- using namespace std;
- int main()
- {
- int i = 5;
- char* str= new char[i];
- bool flag;
- cout << "Enter elements of your string:" << endl;
- do
- {
- cin >> str[i];
- if (str[i] = 1, 2, 3, 4, 5, 6, 7, 8, 9, 0)
- {
- flag = true;
- }
- }
- while (flag==false);
- int j = strlen(str);
- cout << "Lenght of your string :" << j << endl;
- delete[] str;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement