Complete Newbie Where to start? 
Author Message
 Complete Newbie Where to start?

My only programming experience was building a rocketship and making it blast
off, in BASIC, too long ago to try to count the years.
I've got an old 386 notebook running DOS 6.2, Borland TurboC 2.01 and the
source code for the games Heretic and Hexen. I want to tear through the actual
code itself to see how all the pieces fit together, but I have no idea where to
start - which file is the first one to read? Is there one file to look for in
any source code that is always the starting point? Or do you just have to read
every file in the directory til you hit one that clues you in?
TIA for any help I can get.
JohnS

"My friends tell me to stay away from the glue,
But how am I gonna keep it together?"
Roy A. Loney, The Flamin' Groovies
--



Wed, 16 Apr 2003 10:59:16 GMT  
 Complete Newbie Where to start?

Quote:

> My only programming experience was building a rocketship and making it blast
> off, in BASIC, too long ago to try to count the years.
> I've got an old 386 notebook running DOS 6.2, Borland TurboC 2.01 and the
> source code for the games Heretic and Hexen. I want to tear through the actual
> code itself to see how all the pieces fit together, but I have no idea where to
> start - which file is the first one to read? Is there one file to look for in
> any source code that is always the starting point? Or do you just have to read
> every file in the directory til you hit one that clues you in?
> TIA for any help I can get.

Search for main(), which is the entry point to all C programs (at least,
this is true when using a conforming hosted implementation).

A handy utility in this regard is the grep program which, I seem to
recall, is supplied with that version of Turbo C.

--
Richard Heathfield
"Usenet is a strange place." - Dennis M Ritchie, 29 July 1999.
C FAQ: http://www.eskimo.com/~scs/C-faq/top.html
K&R answers, C books, etc: http://users.powernet.co.uk/eton
--



Sun, 20 Apr 2003 08:21:06 GMT  
 Complete Newbie Where to start?

Quote:

> My only programming experience was building a rocketship and making it blast
> off, in BASIC, too long ago to try to count the years.  I've got an old 386
> notebook running DOS 6.2, Borland TurboC 2.01 and the source code for the
> games Heretic and Hexen. I want to tear through the actual code itself to see
> how all the pieces fit together, but I have no idea where to start - which
> file is the first one to read? Is there one file to look for in any source
> code that is always the starting point? Or do you just have to read every
> file in the directory til you hit one that clues you in?

I'd *strongly* suggest that if you've had so little programming experience,
that you don't go straight for such a huge program as Heretic or Hexen.
Start out with a simple text-based program whose flow you can easily follow
by looking through the source. From there, you can build up to bigger and
more complex programs.

Moshe

--

wreck.org bellsouth.net resnet.gatech.edu burdell.org yo.dhs.org gooning.org


--



Sun, 20 Apr 2003 08:22:28 GMT  
 Complete Newbie Where to start?

Quote:

>My only programming experience was building a rocketship and making it blast

none of my work got that far, it never left earth, so you
didn't do bad, and even so with BASIC!  ;-)

 >off, in BASIC, too long ago to try to count the years.

Quote:
>I've got an old 386 notebook running DOS 6.2, Borland TurboC 2.01 and the
>source code for the games Heretic and Hexen. I want to tear through the actual
>code itself to see how all the pieces fit together, but I have no idea where to
>start - which file is the first one to read? Is there one file to look for in
>any source code that is always the starting point? Or do you just have to read
>every file in the directory til you hit one that clues you in?

Try to find the file with the function called 'main', it's the entry point of
your program

Rob Windgassen
--



Sun, 20 Apr 2003 08:22:35 GMT  
 Complete Newbie Where to start?
Boognish Rising schrieb in Nachricht ...

Quote:
>My only programming experience was building a rocketship and making it
blast
>off, in BASIC, too long ago to try to count the years.
>I've got an old 386 notebook running DOS 6.2, Borland TurboC 2.01 and the
>source code for the games Heretic and Hexen. I want to tear through the
actual
>code itself to see how all the pieces fit together, but I have no idea
where to
>start - which file is the first one to read? Is there one file to look for
in
>any source code that is always the starting point? Or do you just have to
read
>every file in the directory til you hit one that clues you in?
>TIA for any help I can get.
>JohnS

OK,
Very first of all you  m u s t  become familiar with the C programming
language  -  this is best done by a book, e.g.
     Kernighan-Ritchie: Programming in C.
In the course of studying the C language text book you will learn that every
C program starts logically with a function called   main(...).
If you then study your compiler manual, you will learn that every program
may consist of only one, of two, three or  (in most cases) of very many
files bearing the name extensions  .C  and  .H  (DOS uses case-insensitive
file names).
So, if you dare to look into the source files without having read a text
book
and the Turbo manual, find that file with name extension  .C  that contains
the  main(...)  function, (e.g. MAIN.C  or  PROGRAM.C), and start from
there.

Have Fun
    Hermann
--

Quote:
>"My friends tell me to stay away from the glue,
>But how am I gonna keep it together?"
>Roy A. Loney, The Flamin' Groovies
>--


--



Sun, 20 Apr 2003 08:22:43 GMT  
 Complete Newbie Where to start?

Rising) wrote in comp.lang.c.moderated:

Quote:
> My only programming experience was building a rocketship and making it blast
> off, in BASIC, too long ago to try to count the years.
> I've got an old 386 notebook running DOS 6.2, Borland TurboC 2.01 and the
> source code for the games Heretic and Hexen. I want to tear through the actual
> code itself to see how all the pieces fit together, but I have no idea where to
> start - which file is the first one to read? Is there one file to look for in
> any source code that is always the starting point? Or do you just have to read
> every file in the directory til you hit one that clues you in?
> TIA for any help I can get.
> JohnS

> "My friends tell me to stay away from the glue,
> But how am I gonna keep it together?"
> Roy A. Loney, The Flamin' Groovies

Execution of a standard C program always begins with a function named
main(), that should be defined with a return type of int and accepting
either zero or two arguments.  If you have a program that consists of
multiple source code files you should find the one that defines main()
and start from there.

Jack Klein
--
Home: http://jackklein.home.att.net
--



Sun, 20 Apr 2003 08:23:33 GMT  
 Complete Newbie Where to start?


Quote:
>My only programming experience was building a rocketship and making it blast
>off, in BASIC, too long ago to try to count the years.
>I've got an old 386 notebook running DOS 6.2, Borland TurboC 2.01 and the
>source code for the games Heretic and Hexen. I want to tear through the actual
>code itself to see how all the pieces fit together, but I have no idea where to
>start - which file is the first one to read? Is there one file to look for in
>any source code that is always the starting point? Or do you just have to read
>every file in the directory til you hit one that clues you in?
>TIA for any help I can get.

Unless you also have at least one respectable reference book on C (as
well as a tutorial written by someone who knows a bit more than Herbert
Schildt, I think you might try doing something different with your
leisure time.

Francis Glassborow      Association of C & C++ Users
64 Southfield Rd
Oxford OX4 1PA          +44(0)1865 246490
All opinions are mine and do not represent those of any organisation
--



Sun, 20 Apr 2003 08:24:09 GMT  
 Complete Newbie Where to start?

Quote:

> My only programming experience was building a rocketship and making it blast
> off, in BASIC, too long ago to try to count the years.
> I've got an old 386 notebook running DOS 6.2, Borland TurboC 2.01 and the
> source code for the games Heretic and Hexen. I want to tear through the actual
> code itself to see how all the pieces fit together, but I have no idea where to
> start - which file is the first one to read? Is there one file to look for in
> any source code that is always the starting point? Or do you just have to read
> every file in the directory til you hit one that clues you in?

Generally, C programs start with function named 'main', which should
be present in one and only one source module. Search for a module
where this function resides. BTW, if you're just starting to learn C,
I doubt the Heretic and Hexen codes are the best approach... From what
I've skimmed through them, they're using a lot of non-standard,
non-portable and hardware specific techniques, such as inline
assembly, I/O port references and interrupt handlers, to name a few.
Also, the Quake2 engine that's used by them (IIRC) is written mostly
in C++, not C.

        AriL
--
Pain and disappointment are inevitable. Misery is optional.
Homepaged at http://www.angelfire.com/or/lukumies
--



Sun, 20 Apr 2003 08:32:52 GMT  
 Complete Newbie Where to start?

Quote:

> My only programming experience was building a rocketship and making it blast
> off, in BASIC, too long ago to try to count the years.
> I've got an old 386 notebook running DOS 6.2, Borland TurboC 2.01 and the
> source code for the games Heretic and Hexen. I want to tear through the actual
> code itself to see how all the pieces fit together, but I have no idea where to
> start - which file is the first one to read? Is there one file to look for in
> any source code that is always the starting point? Or do you just have to read
> every file in the directory til you hit one that clues you in?

Search for a function called main(). Then be afraid, be very afraid -
source code for that kind of game is not only rather complex, it's also
wildly unportable, and thus not really suited to learn C from. Buy a
good book instead.

Richard
--



Sun, 20 Apr 2003 08:32:57 GMT  
 Complete Newbie Where to start?

Quote:

> I've got an old 386 notebook running DOS 6.2, Borland TurboC 2.01
> and the source code for the games Heretic and Hexen. I want to tear
> through the actual code itself to see how all the pieces fit
> together, but I have no idea where to start

.. nor will you ever likely be able to get an idea just from staring
at project source as big and involved as that of a modern 3D game.
Esp. not with your amount of C knowledge, which you claim barely
exists.  You'll want to start out *very* much lower. As in: get
yourself a C tutorial or textbook, and come back to those sources when
you know the language. You wouldn't try to learn medieval language and
medieval mythology at the same time by fighting your way through the
Beowulf manuscript, either, would you?

Not even the developers of those games themselves are likely to be
limiting themselves to reading individual source files from the DOS
prompt. There are tools to help you gain and maintain the larger
perspective. SourceNavigator is an example of such a tool, but many
serious programming environments contain such a thing themselves,
already. At the very minimum, you need an overview of the function
call hierarchy, a.k.a. the 'call tree', or a crossreference listing.

--

Even if all the snow were burnt, ashes would remain.
--



Sun, 20 Apr 2003 08:33:00 GMT  
 
 [ 10 post ] 

 Relevant Pages 

1. Complete Newbie-Thanx for help

2. complete newbie question

3. Complete newbie, trouble with unsigned ints.

4. Complete C newbie here...

5. Complete Newbie Question

6. Complete Newbie Quest

7. ***COMPLETE PROGRAMMING NEWBIE: PLEASE HELP!!!***

8. newbie, can't complete statements

9. complete MFC newbie needs help...

10. Newbie: BC++ 3.1 reading COMPLETE strings

11. Newbie: Starting C

12. newbie: just started C course

 

 
Powered by phpBB® Forum Software