Advertisement
Guest User

Untitled

a guest
Feb 1st, 2015
185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. #include <iostream>
  2. #include <conio.h>
  3.  
  4.  
  5.  
  6. int main()
  7. {
  8.  
  9. char str[100] = "";
  10. char c= '|', c1;
  11. int index = 0;
  12.  
  13. do
  14.  
  15. {
  16. c1=(char)_getch();
  17. system ("cls");
  18. if(c1 == 'D' || c1 == 'd');
  19. {
  20. for(int i(0); i <= index; i++)
  21. if(i != index)
  22. str[i]=' ';
  23. else str[i] = c;
  24. str[index+1] = '\0';
  25. index++;
  26. }
  27. cout << str;
  28. }while(c1 != 'q');
  29.  
  30.  
  31. _getch();
  32. return 0;
  33.  
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement