Program not reading source files or functions

Hello all! I am making a program with multiple functions across two different source files. I have a header file, my function main, and a function called RandCard. When I put in my function into main however it seems like the program will not read or use the functions. I have tried making an example program to see and compared it to my program (which I will begin calling "MyFirstProgram") and they look identical, accept one will run fine and they other wont. Here is MyFirstProgram:

############################

Header file:
//File identifiers (?)
#ifndef HEADERFILE4GAME1_H //Need file name all caps
#define HEADERFILE4GAME1_H //Need file name all caps


//Libraries
#include <time.h>
#include <iostream>
#include <fstream>
#include <string>
#include <cmath>
#include <cstdlib>
#include <vector>
#include <algorithm>

using namespace std;

int RandCard();
void test();

#endif

Main file:

#include "Headerfile4Game1.h"

int RandCard();
void test();

int main()
{
cout << "word";
int RandCard();
void test();
}

void test()
{
cout << "test";
}

Function file:

#include "Headerfile4Game1.h"

int RandCard()
{
cout << "test";

return 0;
}


###############################

Note that it will print "word" Which is inside of main, but it will not do anything with the functions, and the function "test" Will also do nothing... SO all I am getting right now is "word" When I should be getting "word test test"
Any help is appreciated, thanks!
When I put in my function into main however it seems like the program will not read or use the functions.


Below, the cout statement is followed by the declarations of two function prototypes.
1
2
3
4
5
6
int main()
{
    cout << "word";
    int RandCard();
    void test();
}


To actually call the two functions:
1
2
3
4
5
6
int main()
{
    cout << "word";
    RandCard();
    test();
}

<ctime> ... time.h is C header (it works, but there can be issues in large projects)

and
int result;
result = RandCard(); //capture the result of the function, the above call throws it away.
Excellent! That seemed to do the trick Chervil, thanks so much! And I made the change to my library you suggested Jonnin, thanks so much!
Registered users can post here. Sign in or register to post.