Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <conio.h>
- int main()
- {
- char str[100] = "";
- char c= '|', c1;
- int index = 0;
- do
- {
- c1=(char)_getch();
- system ("cls");
- if(c1 == 'D' || c1 == 'd');
- {
- for(int i(0); i <= index; i++)
- if(i != index)
- str[i]=' ';
- else str[i] = c;
- str[index+1] = '\0';
- index++;
- }
- cout << str;
- }while(c1 != 'q');
- _getch();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement