Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include <ostream>
- using namespace std;
- class words {
- char word1;
- public:
- words(); // конструктор инициализации слова заданным словом-инициализатором
- words(int a, char b); // инициализации слова заданным количеством повторов заданного символа
- void print()
- {
- cout << word1;
- }
- };
- // реализация конструкторов
- words::words(void)
- {
- word1 = 'sjGE';
- }
- words::words(int a, char b)
- {
- word1 = 'AAAA';
- //for (int i = 0; i < a; i++)
- //{
- // word1[i] = b;
- //}
- }
- int main()
- {
- char sl;
- int a = 4;
- words s1(NULL);
- s1.print();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement