Simple automatic typing in C++
#1
Here is a demo that automatically types a message on the console screen.

Code:
#include <iostream>
#include <conio.h>
#include <windows.h>

using namespace std;

int main(){

    unsigned int i;
    char Msg[] = {"This is a test of The Joyful Programmer.\r\nThis is only a test.\r\nThe End\r\n\r\n<PRESS ANY KEY TO CONTINUE>"};

    for (i=0;i < sizeof(Msg)/sizeof(Msg[0]);i++)
    {
        cout << Msg[i];
        Sleep(50);
    }

    getch();

return 0;
}


I wrote this C++ demo in Code::Blocks and used 64-Bit G++ to compile it.
Dedicated to empowering computer programming hobbyists, tinkerers, amateurs, and enthusiasts.
profile for Walter Whitman at Stack Overflow, Q&A for professional and enthusiast programmers


Reply