Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit e4b7da4

Browse files
author
hengxin
committed
1-4-josephus-linkedlist: +struct, +josephus, +linkedlist, func-pointer, +qrcode
1 parent f7424e4 commit e4b7da4

15 files changed

+397
-0
lines changed

‎README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,5 @@ See the code in [this repository](https://github.com/hengxin/learning-c-cplusplu
66

77
TODO:
88
- [ ] Overview of this class (separated from Lecture 1)
9+
- [ ] Guessing Game for the illustration of IO
10+
- [ ] Conway's Game of Life for the illustration 2D arrays
Binary file not shown.
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
\documentclass[]{beamer}
2+
3+
\input{preamble}
4+
5+
%%%%%%%%%%
6+
\title[\titletext]{\titletext}
7+
\subtitle{--- \subtitletext}
8+
9+
\author[Hengfeng Wei]{\large 魏恒峰}
10+
\titlegraphic{\includegraphics[height = 2.0cm]{figs/qrcode-programming-tutorial.png}}
11+
\institute{hfwei@nju.edu.cn}
12+
\date{2017年11月10日}
13+
14+
\AtBeginSection[]{
15+
\begin{frame}[noframenumbering, plain]
16+
\frametitle{\titletext}
17+
\tableofcontents[currentsection, sectionstyle=show/shaded, subsectionstyle=show/show/hide]
18+
\end{frame}
19+
}
20+
%%%%%%%%%%
21+
\begin{document}
22+
23+
\maketitle
24+
25+
\input{parts/josephus}
26+
\input{parts/struct}
27+
\input{parts/linkedlist}
28+
\input{parts/func-pointer}
29+
30+
\thankyou{}
31+
32+
\end{document}
33+
%%%%%%%%%%

‎tutorial/1-4-josephus-linkedlist/1-4-josephus-linkedlist.tex.latexmain

Whitespace-only changes.
31.2 KB
Loading[フレーム]
22.7 KB
Loading[フレーム]
119 KB
Loading[フレーム]
370 Bytes
Loading[フレーム]
3.96 KB
Loading[フレーム]
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
%%%%%%%%%%%%%%%
2+
\begin{frame}{}
3+
\centerline{\LARGE Function Pointer}
4+
\end{frame}
5+
%%%%%%%%%%%%%%%
6+
7+
%%%%%%%%%%%%%%%
8+
\begin{frame}[fragile]{}
9+
\begin{lstlisting}[style = Cstyle]
10+
int (*fptr)(int); // fptr is a function pointer
11+
12+
int square(int num) {
13+
return num * num;
14+
}
15+
\end{lstlisting}
16+
17+
\begin{lstlisting}[style = Cstyle]
18+
int n = 5;
19+
fptr = square; // fptr points to a function
20+
fptr(n);
21+
\end{lstlisting}
22+
\end{frame}
23+
%%%%%%%%%%%%%%%
24+
25+
%%%%%%%%%%%%%%%
26+
\begin{frame}[fragile]{}
27+
\begin{lstlisting}[style = Cstyle]
28+
typedef void (*fptr_show)(void *data);
29+
30+
void show(LinkedList *list, fptr_show show);
31+
\end{lstlisting}
32+
33+
\centerline{\large \cyan{(\texttt{linkedlist.h})}}
34+
35+
\vspace{0.60cm}
36+
\pause
37+
\begin{lstlisting}[style = Cstyle]
38+
void show_integer(const int *integer);
39+
40+
show(&list, show_integer);
41+
\end{lstlisting}
42+
43+
\centerline{\large \cyan{(\texttt{josephus-linkedlist.c})}}
44+
\end{frame}
45+
%%%%%%%%%%%%%%%
46+
47+
%%%%%%%%%%%%%%%
48+
\begin{frame}[fragile]{}
49+
\begin{lstlisting}[style = Cstyle]
50+
typedef int (*fptr_compare)(void *data1, void *data2);
51+
52+
Node *get_node(LinkedList *list, fptr_compare compare, void *data);
53+
\end{lstlisting}
54+
55+
\centerline{\large \cyan{(\texttt{linkedlist.h})}}
56+
57+
\vspace{0.60cm}
58+
\pause
59+
\begin{lstlisting}[style = Cstyle]
60+
int compare_integer(int *data1, int *data2);
61+
62+
get_node(&list, compare_integer, &val);
63+
\end{lstlisting}
64+
65+
\centerline{\large \cyan{(\texttt{josephus-linkedlist.c})}}
66+
\end{frame}
67+
%%%%%%%%%%%%%%%
68+
69+
%%%%%%%%%%%%%%%
70+
\begin{frame}[fragile]{}
71+
\begin{lstlisting}[style = Cstyle]
72+
void qsort (void *base, size_t num, size_t size,
73+
int (*compar)(const void*, const void*));
74+
\end{lstlisting}
75+
76+
\centerline{\large \cyan{(\texttt{\#include <stdlib.h>})}}
77+
\end{frame}
78+
%%%%%%%%%%%%%%%

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /