Re: How to decipher a large program.




Rob Thorpe wrote:
Chad wrote:
I recently downloaded a program that inserts captions in .jpeg files.
However, I'm sort of at a loss on where to start to see how it
works.The program has 3 c files and 4 header files. In the header
files, the
person comments on what function is supposed to do.

The question is, how do I figure out how each of these functions
interact with each other? Do I just get
a pen/paper and start jotting down notes? I was maybe thinking of
constructing some kind of flow
diagram to see how these functions interact. Any ideas?

Starting from "main" can be useful, so can starting by debugging.
Often in a C program there is an include file with the same name as the
program which contains the most central definitions. This can also be
a good place to start.

I took a closer look at the files. There is an include file with the
same name as one of the c programs. However, this c file doesn't have
"main". The "main" is in another file. I'll start
debugging this when I get home from work later on today.


Chad

.



Relevant Pages

  • Re: Anything After This is Gravy!!!!!!!!!!!
    ... header. ...   While it's always nice to see ... up for a Met loss. ... Met fans should be ...
    (alt.sports.baseball.ny-mets)
  • Re: No source visible in debugger
    ... I don't think 9.6 changed anything with debugging. ... when I could no longer debug. ... >> some cases I've combined code from several sample plugins. ... >> in more header includes that are typically found in the sample plugins. ...
    (comp.sys.mac.programmer.codewarrior)
  • Header files with enums instead of defines?
    ... Has anybody thought about replacing #defines with enums in header ... It would make debugging a whole lot easier. ... currently looking at a debug printout which contains: ...
    (freebsd-arch)
  • Re: Header files with enums instead of defines?
    ... >> Has anybody thought about replacing #defines with enums in header ... It would make debugging a whole lot easier. ... Foe example, I'm ...
    (freebsd-arch)
  • Mutt/postfix issue
    ... Mail sent via mutt and postfix must appear to have come from my mailbox at ... my ISP, H.A.J.Koster@xxxxxxxxx (as in the header of this message), NOT ... loss to fix the username part. ...
    (Ubuntu)