CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Dec 2004
    Location
    Paso de Robles
    Posts
    296

    Reading a Large Library or Program

    I like to look at source code whenever I can, but I can never figure out where to start. Obviously, the first step is to find main and then read on from there. Libraries are a different story, and I am still not sure where to start reading. Does anyone have any tips for looking over a large library that you have never seen before?

  2. #2
    Join Date
    Apr 1999
    Posts
    27,449

    Re: Reading a Large Library or Program

    Quote Originally Posted by binarybob0001
    I like to look at source code whenever I can, but I can never figure out where to start. Obviously, the first step is to find main and then read on from there. Libraries are a different story, and I am still not sure where to start reading. Does anyone have any tips for looking over a large library that you have never seen before?
    It's no different than "normal" source code.

    The library must have some function that gets called first, second, third, etc. to make the library useful, just as a regular C++ program has a main() function, that calls other functions.

    Regards,

    Paul McKenzie

  3. #3
    Join Date
    Dec 2004
    Location
    Paso de Robles
    Posts
    296

    Re: Reading a Large Library or Program

    So there is no magic tool that helps you find the first, second and third functions, just hard work?

  4. #4
    Join Date
    Apr 1999
    Posts
    27,449

    Re: Reading a Large Library or Program

    Quote Originally Posted by binarybob0001
    So there is no magic tool that helps you find the first, second and third functions, just hard work?
    The way you figure out library source code is to look at the sample programs that use the library. That's how you know what function is being called first, second, third, etc.

    Just looking at the library code, with no context as to how to call the functions in the library and which functions to call, isn't the way to go about understanding the library.

    Regards,

    Paul McKenzie

  5. #5
    Join Date
    Dec 2004
    Location
    Paso de Robles
    Posts
    296

    Re: Reading a Large Library or Program

    Thanks McKenzie.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured