Hello everyone
I've been programming C++ casually for about half a year now, and my programs are starting to grow large. I've been monitoring these boards for some time now, and some times i see some of you gurus including and making your own header files for storing away classes and functions.
There's an entry in the FAQ about making headers, but i just can't get it to work properly, it's quite frustrating, here is my example application:
And the "function.h" header:Code:#include <iostream>
#include <windows.h>
#include <string.h>
#include "function.h"
using namespace std;
int main()
{
char sentence1[] = "Why ain't this working!?";
int length = strlen(sentence1);
printout(sentence1, length, 100);
}
All i get is a compiler error saying that printout is undeclared, i have tried everything, but to no prevail.Code:#ifndef _FUNCTION_H
#define _FUNCTION_H
inline void printout(char sentence[], int length, int interval)
{
int x;
for (x=0; x<length; x++)
{
cout<< sentence[x];
Sleep(interval);
}
}
#endif
Thanks in advance :)