Horje
how to make a running text in c++ Code Example
how to make a running text in c++
#include <iostream>
#include <windows.h>
#include <conio.h>
using namespace std;

int main()
{
  COORD cursor = {0,0};
  HANDLE outputhandle = GetStdHandle(STD_OUTPUT_HANDLE);
  int i = 0;

  do {
    if(i<=0){
      while(i < 100){
        system("cls");
        cursor.X = i;
        cursor.Y = 10;
        SetConsoleCursorPosition(outputhandle,cursor);
        cout<<"Bonnary";
        Sleep(10);
        if(i == 100) i = 0;
        i++;
      }
    }
    else{
      while(i > 0){
        system("cls");
        cursor.X = i;
        cursor.Y = 10;
        SetConsoleCursorPosition(outputhandle,cursor);
        cout<<"Bonnary";
        Sleep(10);
        if(i == 0) i = 100;
        i--;
      }
    }
  }while(!kbhit());
  return 0;
}




Cpp

Related
how to run the code Code Example how to run the code Code Example
c++ loop Code Example c++ loop Code Example
check if a string is a prefix of another c++ Code Example check if a string is a prefix of another c++ Code Example
txt auslesen c++ Code Example txt auslesen c++ Code Example
convert c program to c++ online Code Example convert c program to c++ online Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
8