game programming question

Started by
23 comments, last by theadamSGT 18 years, 8 months ago
i was wondering how do you split the source code into more files
Advertisement
Does this article answer your questions?
thats what i want to do but it doesnt say how
You create a new sourcefile.. you place or move code into it..

You usually share functions across sourcefiles using shared headers containing the function declarations, & share variables by including the variable declarations preceeded with the "extern" keyword in them (the headers)
Once again classes & structures are shared in the same manor - the declarations are usually placed in the headers & the definitions are written in specific sourcefiles
when the sourcecode goes through the linking stage (after each file is compiled) all of this is magically reconnected again

It was a terribly general question so I'm afraid I wasn't sure entirely how to answer ..

Somethings are best learnt by delving in & trying yourself until things eventually "click"
(they're usually the things taken for granted as simple common knowledge afterwards);
those things are usually the hardest to explain because of that ;]
_______________________________ ________ _____ ___ __ _`By offloading cognitive load to the computer, programmers are able to design more elegant systems' - Unununium OS regarding Python
i sort of knew that i just dont know how to do it
well if you explained the specific part you are having trouble understanding..?

Are you having trouble creating the sourcefiles themselves in the ide & adding them to the project?
_______________________________ ________ _____ ___ __ _`By offloading cognitive load to the computer, programmers are able to design more elegant systems' - Unununium OS regarding Python
how do you post the box where you put source codes in
i dont know what headers to include andwhere to put stuff like that
in between [#source][#/source] without the # (that's the general tags)

other useful stuff is in the forum faq

regards

/thallish
regards/thallishI don't care if I'm known, I'd rather people know me
thanks

This topic is closed to new replies.

Advertisement