I was wondering how to make a predefined void function in C++. I can make int functions using this message and I've looked around for tutorials. It seems that I have done everything correctly, but my standard code::blocks complier keeps giving me errors.
I have typed the following at the top of my main.cpp file:
#include "header.h"
I have typed the following inside my header.h file:
void function();
And I have made a file called function.cpp and typed this at the top:
Also I was wondering if I could make 2 or 3 functions work siminutenliously at dikfferent parts of the screen.
For example, could I make a timer or something put that at the top of the screen and a void function in the center part of the screen and make them work at the same time?
I just tried that by building my entire workspace and it still comes up with the same error.
Oh wait sorry, I just tried to compile the file, yet it says it isn't asssigned to any target
Did you include header.h in the cpp file where you are trying to use function()?
As for simultaneous execution of functions, that's a complex topic called multi-threading, where you start other threads from functions. The way to do it is platform dependent, and there are some libraries that greatly simplify it, but overall multithreading is much harder than any other aspect of C++, and it is difficult to get right. I suggest some Googling if you're up to the task...