To convert my code as a header file...

Hi
Dear all

I implemented chi square test. Now i want to convert this code as .h header file. so, my other colleague can use this very simply as math library. like this.

#include "indepTest.h"

My code is like this.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16

void chi_square_test( input parameter)
{
.............
............
....
}

void main ()
{
..
..
...
chi_square_test ( parameters);

}


i think you are understand my objective.

Thanks in advance.
move chi_square_test in a cpp file without a main and create a header and put there a declaration of chi_square_test
Thanks dear,

but to use it wether i have to include this file in my visual studio project ?

I want to implement without including this file in the project.
closed account (S6k9GNh0)
? I'm not sure what your trying to do ?

1
2
3
4
5
6
#ifndef _INDEPTEST_H
#       define _INDEPTEST_H

void chi_square_test( input parameter);

#endif // 


Simple as that. Not very often will you see main() declared in a library of any sort since the library is simply used for functions and algorithms. Be sure to include the header in the implementation file or the function won't get defined.

I'm not really sure what you mean by you don't want to include it inside your project but you want to use it. Normally in a library, you have one or two headers, usually branching off into smaller headers, which has function declarations. Then you include the header in your current project and make sure that the headers are defined. Then you call the functions you want and that's about it.
Last edited on
Topic archived. No new replies allowed.