Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions tex/ch10x.tex
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ \subsection{CHAPTER 10: Pointers to
bubble\_1.c, which follows:

----------- Program 10.1 -----------------------------------
\inputminted{c}{../src/ch10-1.c}
\inputminted[breaklines]{c}{../src/ch10-1.c}
--------- end program 10.1 -----------------------------------

The bubble sort is one of the simpler sorts. The algorithm scans the
Expand Down Expand Up @@ -49,7 +49,7 @@ \subsection{CHAPTER 10: Pointers to
bubble\_2.c:

----------- Program 10.2 -----------------------------------
\inputminted{c}{../src/ch10-2.c}
\inputminted[breaklines]{c}{../src/ch10-2.c}
--------- end program 10.2 -----------------------------------

If our goal is to make our sort routine data type independent, one way
Expand All @@ -59,7 +59,7 @@ \subsection{CHAPTER 10: Pointers to
begin with, we'll stick with pointers to type integer.

----------- Program 10.3 -----------------------------------
\inputminted{c}{../src/ch10-3.c}
\inputminted[breaklines]{c}{../src/ch10-3.c}
--------- end program 10.3 -----------------------------------

Note the changes. We are now passing a pointer to an integer (or array
Expand All @@ -72,7 +72,7 @@ \subsection{CHAPTER 10: Pointers to
become more type insensitive. This is shown in bubble\_4.

----------- Program 10.4 -----------------------------------
\inputminted{c}{../src/ch10-4.c}
\inputminted[breaklines]{c}{../src/ch10-4.c}
--------- end program 10.4 -----------------------------------

Note that, in doing this, in \textbf{compare()} we had to introduce the
Expand Down Expand Up @@ -105,7 +105,7 @@ \subsection{CHAPTER 10: Pointers to
modules carefully for differences.

----------- Program 10.5 -----------------------------------
\inputminted{c}{../src/ch10-5.c}
\inputminted[breaklines]{c}{../src/ch10-5.c}
--------- end program 10.5 -----------------------------------

Note that I have changed the data type of the array from \textbf{int} to
Expand Down Expand Up @@ -134,7 +134,7 @@ \subsection{CHAPTER 10: Pointers to
were commented out in bubble5.c.

----------- Program 10.6 -----------------------------------
\inputminted{c}{../src/ch10-6.c}
\inputminted[breaklines]{c}{../src/ch10-6.c}
--------- end program 10.6 -----------------------------------

But, the fact that \textbf{bubble()} was unchanged from that used in
Expand Down Expand Up @@ -182,7 +182,7 @@ \subsection{CHAPTER 10: Pointers to
different types of data.

----------- Program 10.7 -----------------------------------
\inputminted{c}{../src/ch10-7.c}
\inputminted[breaklines]{c}{../src/ch10-7.c}
--------- end program 10.7 -----------------------------------

References for Chapter 10:
Expand Down
2 changes: 1 addition & 1 deletion tex/ch1x.tex
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ \subsection{CHAPTER 1: What is a
following program and then review the code and the output carefully.

----------- Program 1.1 -----------------------------------
\inputminted{c}{../src/ch1-1.c}
\inputminted[breaklines]{c}{../src/ch1-1.c}
--------- end program 1.1 -----------------------------------

Note: We have yet to discuss those aspects of C which require the use of
Expand Down
2 changes: 1 addition & 1 deletion tex/ch2x.tex
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ \subsection{CHAPTER 2: Pointer types and
by dereferencing our pointer. The following code illustrates this:

----------- Program 2.1 -----------------------------------
\inputminted{c}{../src/ch2-1.c}
\inputminted[breaklines]{c}{../src/ch2-1.c}
--------- end program 2.1 -----------------------------------

Compile and run the above program and carefully note lines A and B and
Expand Down
2 changes: 1 addition & 1 deletion tex/ch3x.tex
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ \subsection{CHAPTER 3: Pointers and
Now, consider the following program:

----------- Program 3.1 -----------------------------------
\inputminted{c}{../src/ch3-1.c}
\inputminted[breaklines]{c}{../src/ch3-1.c}
--------- end program 3.1 -----------------------------------


Expand Down
4 changes: 2 additions & 2 deletions tex/ch5x.tex
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ \subsection{CHAPTER 5: Pointers and
operator as in:

----------- Program 5.1 -----------------------------------
\inputminted{c}{../src/ch5-1.c}
\inputminted[breaklines]{c}{../src/ch5-1.c}
--------- end program 5.1 -----------------------------------

Now, this particular structure is rather small compared to many used in
Expand Down Expand Up @@ -107,7 +107,7 @@ \subsection{CHAPTER 5: Pointers and
With that in mind, look at the following program:

----------- Program 5.2 -----------------------------------
\inputminted{c}{../src/ch5-2.c}
\inputminted[breaklines]{c}{../src/ch5-2.c}
--------- end program 5.2 -------------------------------------

Again, this is a lot of information to absorb at one time. The reader
Expand Down
2 changes: 1 addition & 1 deletion tex/ch6x.tex
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ \subsection{CHAPTER 6: Some more on Strings, and Arrays of
character arrays.

----------- Program 2.1 -----------------------------------
\inputminted{c}{../src/ch2-1.c}
\inputminted[breaklines]{c}{../src/ch2-1.c}
--------- end program 2.1 -----------------------------------

Because of the double de-referencing required in the pointer version,
Expand Down
8 changes: 4 additions & 4 deletions tex/ch9x.tex
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ \subsection{CHAPTER 9: Pointers and Dynamic Allocation of
Consider now:

----------- Program 9.1 -----------------------------------
\inputminted{c}{../src/ch9-1.c}
\inputminted[breaklines]{c}{../src/ch9-1.c}
--------- end program 9.1 -----------------------------------

Here I have assumed an ANSI compiler so a cast on the void pointer
Expand Down Expand Up @@ -163,7 +163,7 @@ \subsection{CHAPTER 9: Pointers and Dynamic Allocation of
each row and point these pointers at each row. Consider:

----------- Program 9.2 -----------------------------------
\inputminted{c}{../src/ch9-2.c}
\inputminted[breaklines]{c}{../src/ch9-2.c}
--------- end program 9.2 -----------------------------------

In the above code \textbf{rowptr} is a pointer to pointer to type
Expand Down Expand Up @@ -207,7 +207,7 @@ \subsection{CHAPTER 9: Pointers and Dynamic Allocation of
memory is contiguous. The code looks like this:

----------- Program 9.3 -----------------------------------
\inputminted{c}{../src/ch9-3.c}
\inputminted[breaklines]{c}{../src/ch9-3.c}
--------- end program 9.3 -----------------------------------

Consider again, the number of calls to malloc()
Expand Down Expand Up @@ -235,7 +235,7 @@ \subsection{CHAPTER 9: Pointers and Dynamic Allocation of
two. Consider the following code:

----------- Program 9.4 -----------------------------------
\inputminted{c}{../src/ch9-4.c}
\inputminted[breaklines]{c}{../src/ch9-4.c}
--------- end program 9.4 -----------------------------------

If you have followed this tutorial up to this point you should have no
Expand Down