IDE help
Moderator: Ras
-
Dave_N
- Posts: 153
- Joined: Fri Sep 30, 2011 7:48 am
Re: IDE help
The advantages might be compile time and portability.
-
kbhearn
- Posts: 411
- Joined: Thu Dec 30, 2010 4:48 am
Re: IDE help
Just organisation really - but it is handy organisation, easier to find the portions of the code you're looking for, easier to extract what's necessary to reuse code in another project (just copy over the .c and .h that contain the pieces you want).
-
Aleks Peshkov
- Posts: 977
- Joined: Sun Nov 19, 2006 9:16 pm
- Location: Russia
- Full name: Aleks Peshkov
Re: IDE help
Some simple chess programs are written as single file. It is possible to split chess source code into several files later, when you will feel the need for it.
-
lucasart
- Posts: 3243
- Joined: Mon May 31, 2010 1:29 pm
- Full name: lucasart
Re: IDE help
A big yes answer you mean ? Unless the reason is that you don't understand how to use multiple source files, the benefit of having multiple sources are obvious. It's as if you said that it's better to write all your program in the main function and put lots of goto there. Of course it's possible... Ugly as hell, but possible. The advantage is dependability. For the same reason that you have independant functions doing separate things that can be reused and tested independantly, you have multiple source filesRobert wrote:Thanks Kevin
Now i really understands the use of .h and #include stuff to the code be accepted to the compiler.
Last question: I am just curious if there are any advantage(speed or size) of use multi sources instead of one big C.
I expect a big no answer.
This is just a question of organization, right?
To moderators: Feel free to move this thread to General Topics if there are to much programmers bored with this discussion.
-
lucasart
- Posts: 3243
- Joined: Mon May 31, 2010 1:29 pm
- Full name: lucasart
Re: IDE help
On the contrary, your question is very relevant to the programming forum. In the general forum, your thread is likely to get polluted by people who don't know anything about programming. Feel free to ask, I'm sure everyone here is happy to help you with programming questions.Robert wrote: To moderators: Feel free to move this thread to General Topics if there are to much programmers bored with this discussion.
If you want to learn and understand in depth the C language, I *strongly* recommend you read this. It's a very good book to learn C, written by none other than the inventors of the C language, and praised by many of the C gurus as the best book on C
Code: Select all
cg.inf.unideb.hu/eng/rtornai/Kernighan_Ritchie_Language_C.pdf