question

Write your question here.

i've been searching all over the tutorials on how to do this but i honestly didn't find it. I was just wondering how can we make the text of the output be shown as like someone is writing it.
like for example when the output is shown it shows that the computer is writing it .

do you guys have any idea on what am i talking and if yes can you please tell me how to do it .
Last edited on
Do you mean, having a delay between each letter appearing on the screen?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#include <iostream>
#include <string>
#include <thread>
#include <chrono>

int main()
{
    std::string message = "Hello, world!";
    for(auto c : message)
    {
        std::cout << c;
        std::this_thread::sleep_for(std::chrono::milliseconds{100});
    }
    std::cout << std::endl;
}
http://ideone.com/WU1yo1 (not visible unless you run it yourself)
Topic archived. No new replies allowed.