Sources: Their Use and Acknowledgment

Table of contents

FAQ


Course lecture

Graphical materials

Works of art

Documentary

Computer subroutines

Article from Lexis-Nexis

Secondary source

More than one source

No author listed

Citing Sources

Microfilm or microfiche

Submit question to FAQ
(Dartmouth only)

How do I cite a computer subroutine?

When you are writing computer programs, you should acknowledge in your own program any direct use of someone else's library subroutines, either standard or instructor-supplied. Most such library routines are self-documented in the statement that tells the program to use them, and need no further citation. A subroutine that you found in some less-standard source does require explicit citation in your program.
For example, suppose you needed a way to print out numbers in various bases, and found a function in a book that would do this for you. Citing this source requires an explicit addition to your source code, as in the following example:


// Print N in any base where 2 <= Base <= 16

// This function appeared in Mark Weiss, _Algorithms,
// Data Structures, and Problem Solving with C++_
// (Menlo Park: Addison-Wesley, 1996) 224.

void PrintInt( unsigned Note N, unsigned int Base )
{
static char DigitTable[] = "0123456789abcdef";

if ( N >= BASE )
PrintInt( N / Base, Base );
cout << DigitTable[ N % Base ];
}

Dartmouth College
Dartmouth College copyright © 1998
www.dartmouth.edu/~sources/faq/subroutines.html