.h files

I am not sure i understand these header files. I have a program that I need to combine with another function in a seperate file. Do I just make a file with the function and save it as a .h file and then call it in the main program? Why would I need a second cpp? Do I call the function file in the second cpp and then call the second cpp in the main? Thanks
You do not "call" files at all. Basically, you put them all in the same "project," and when you compile, the compiler will link them all together.

You usually will put the prototype of the function in the .h files, and the actual code in the .cpp. Then, go to your "main" .cpp and #include all of the .h files.
Topic archived. No new replies allowed.