Hi, I'm wondering what's wrong.
Here's the code:
#include "stdafx.h"
#include <iostream>
#include <windows.h>
#include <ctime>
void random();
{
doPrint("Random")
}
int main()
{
int x;
int y;
std::cout << "Please enter two single digit numbers:" << std::endl;
std::cin >> x;
if ( x < 10)
{
std::cout << "Second number:" << std::endl;
}
else
{
std::cout << "Single digit please" << std::endl;
std::cin >> x;
}
std::cin >> y;
if (y < 10)
{
std::cout << "Good job" << std::endl;
}
else
{
std::cout << "Single digit please" << std::endl;
std::cin >> y;
}
std::cout << "Loading";
std::cout.flush();
for (int j = 0; j < 3; j++) {
std::cout << "\rLoading \rLoading";
for (int i = 0; i < 3; i++) {
std::cout << ".";
Sleep(500);
}
std::cout << "\b\b\b \b\b\b";
}
std::cout << "\n\nYour final number is: " << x + y / 10 * x << std::endl;
return 0;
}
The curly brace after void random(); has the error. Anyone know why?
You should not put a semicolon at the end of the function header when defining the function.
Thanks! I know that it's not defined I was just testing something out and couldn't work out the error.
Problem solved.