Search
 
SCRIPT & CODE EXAMPLE
 

CPP

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;
}
Comment

PREVIOUS NEXT
Code Example
Cpp :: codeform 
Cpp :: ue4 foreach loop c++ 
Cpp :: c++ fps sleep while loop 
Cpp :: C++ if...else Statement 
Cpp :: the partition function of a system is given by z= 1/(1-e^-bEi), calculate the total energy of the system 
Cpp :: Int main ( ) { int i,n; cinn; i=n; while(i=1) { i=i+5; i=i-6; } } 
Cpp :: floating point exception 
Cpp :: button creation in C++ GUI 
Cpp :: map update field elixir 
Cpp :: show mouse c++ 
Cpp :: inverse elment of array c++ 
Cpp :: how to find the mean and standard deviation of trqiing dataset in pytorch 
Cpp :: rotateArray 
Cpp :: C++ Things to Remember 
Cpp :: dijkstra algorithm in c++ geeksforgeeks 
Cpp :: remove element from vector c++ by index 
Cpp :: template in cpp 
Cpp :: how to initialize a vector in c++ 
Cpp :: search in vector of pairs c++ 
Cpp :: conditions in c++ 
Cpp :: split string by delimiter cpp 
Cpp :: imgui menu bar 
Cpp :: nazi crosshair c++ 
C :: bold text in c 
C :: .gitkeep file 
C :: zizag c 
C :: octave sum all elements in matrix 
C :: c get random float 
C :: how to get add to number C 
C :: c Program to check if a given year is leap year 
ADD CONTENT
Topic
Content
Source link
Name
1+8 =