954,496 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

How to handle #include & organize source files

Hi people:

Here is a very basic question, but it has been bugging the living hell out of me.


I am using Visual Studio 2005 and progamming in C. The whole program's skeleton was given to me, and NOT to be altered. There are several header files in the "header" folder and several source files in the "source" folder. I was supposed to create another source file called "stringQueue.c" and implement all the functions whose signatures declared in the "stringQueue.h" (already given).

So I created this "new" source file and defined those functions, and lastly I put #include "stringQueue.h" on the top of the stringQueue.c file. But when I tried to complie the program, (main() is in another source file), it gave me more errors and warnings than I could handle.
My solution was to cut all the functions in the stringQueue.c file and pasted them into the bottom of the source file where the main() was, and it went without any problems.
I really do not know how to use this #include or how to organize large program into smaller source files. Can any one you help?

Many thanks

yuzhang
Light Poster
43 posts since May 2006
Reputation Points: 10
Solved Threads: 0
 

Hi you guys, the problem has been solved. I guess I need more time on programming and learning.
Thanks:mrgreen:

yuzhang
Light Poster
43 posts since May 2006
Reputation Points: 10
Solved Threads: 0
 

could you tell me?
lol

LieAfterLie
Light Poster
42 posts since May 2006
Reputation Points: 23
Solved Threads: 2
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You