I am stuck trying to cout a message with a 3-second delay. I may be trying to do it the hard way by using goto. If anyone has any suggestions they would be greatly appreciated. Thanks!
Code:
#include <iostream>
#include <string>
using namespace std;
int seconds = 0;
int timer = seconds + 1;
int clock = timer;
int main() {
string namevar;
cout << "Enter your name: " << flush;
cin >> namevar;
std::cout << "Welcome " << namevar << ". This program was created to teach the user how to code using C++" "\n";
clockf1:do {
seconds = timer;
if (clock < 3);
timer = seconds + 1;
goto clockf1;
}
while (clock == 3);
cout << "When learning any coding language the first step is to understand how to print Hello World. So let us begin!" << flush;
}