I would like help with making a program 'type' out the text as the program is running i.e. not having the entire line appear at once but letter by letter.
geg13
0
Newbie Poster
Recommended Answers
Jump to Postput a system pause between letters. Assuming you are coding on MS-Windows.
#include <windows.h> ... ... string msg = "This is a test"; for(int i = 0; i < msg.length(); i++) { cout << msg[i]; cout.flush(); sleep(1000); // delay 1 second }
Jump to Postmake a function out of that code then send the strings to it.
All 6 Replies
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
geg13
0
Newbie Poster
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
geg13
0
Newbie Poster
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
geg13
0
Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.