Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
ОПК, семинар №8
Search
Ilya
March 12, 2015
Education
58
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
ОПК, семинар №8
Указатели на функции
Ilya
March 12, 2015
More Decks by Ilya
See All by Ilya
Программирование на ЯВУ, семинар 3
ilya
0
170
Программирование на ЯВУ, семинар 2
ilya
0
75
ОПК, семинар №6
ilya
0
79
ОПК, семинар №4
ilya
0
110
ОПК, семинар №2
ilya
0
93
Other Decks in Education
See All in Education
学生のうちに考えておきたい信頼の話
suisan
1
810
2026年度春学期 統計学 第14回 分布についての仮説を検証する ― 仮説検定(1) (2026. 7. 2)
akiraasano
PRO
0
160
生成AIとの付き合い方/ How to work with AI
kaityo256
PRO
3
450
ちいかわを読め
uchi8977
1
370
Geografía y Fútbol: Chattanooga Geografía del Búnker de La Roja.
juanmartin2026
1
12k
観察、仮説、実行、検証、計画、提案を一年で3000回トレーニングする方法/3000 Thinking Loops in 365 Days
moriyuya
5
1.4k
1人 × AI、1か月でここまで作れる ー 数年前の外注換算3.8〜7.4億円・241〜379人月分の作業を、AI費用 約10万円・31日で
frievea
0
550
新入社員を「あの子」と呼ばない運動 -PBL その前に- / Stop Calling New Hires "Kids"
aokiplayer
2
890
オンラインコミュニティ TRY部 体験マニュアル
ytapples613
0
370
[2026前期火5] 論理学(京都大学文学部 前期 第12回)「証明を走らせる:カリー・ハワード対応」
yatabe
0
330
Science Tokyo University for International Research Excellence scheme_April 2026
sciencetokyo
PRO
0
330
LEGO Geometry Tutorial
arnoknobbe
0
580
Featured
See All Featured
Testing 201, or: Great Expectations
jmmastey
46
8.3k
What's in a price? How to price your products and services
michaelherold
247
13k
Principles of Awesome APIs and How to Build Them.
keavy
128
18k
The Pragmatic Product Professional
lauravandoore
37
7.5k
Docker and Python
trallard
47
4.2k
A Guide to Academic Writing Using Generative AI - A Workshop
ks91
PRO
1
500
Designing Dashboards & Data Visualisations in Web Apps
destraynor
232
55k
A better future with KSS
kneath
240
18k
Building Adaptive Systems
keathley
44
3.2k
4 Signs Your Business is Dying
shpigford
187
23k
How to Align SEO within the Product Triangle To Get Buy-In & Support - #RIMC
aleyda
2
1.8k
Jamie Indigo - Trashchat’s Guide to Black Boxes: Technical SEO Tactics for LLMs
techseoconnect
PRO
0
690
Transcript
Указатели на функции
#include <stdio.h> #include <stdlib.h> double long_calculation(double x, unsigned n) {
double result = 1.0; unsigned i; for(i = 0; i < n; i++) { result *= x; sleep(1); } return result; } int main() { double my_power = long_calculation(2.0, 5); printf("Result: %lf\n", my_power); return 0; }
Callbacks void printer(int i) { printf("Progress: %d%% complete\n", i); }
int main() { void (*printer_func)(int); printer_func = &printer; printer_func(20); return 0; }
double long_calculation(double x, unsigned n, void (*callback)(int)) { double result
= 1.0; unsigned i, progress; for(i = 0; i < n; i++) { result *= x; progress = (unsigned) (((double) i)/ n * 100); callback(progress); sleep(1); } return result; }
typedef void (*callback_func)(int); double long_calculation(double x, unsigned n, callback_func callback);
int main() { callback printer_func = &printer; double my_power = long_calculation(2.0, 3, printer_func); printf("Result: %lf\n", my_power); return 0; }
void bubble_sort(int *base, size_t size) { int temp; size_t i,
j; for(i = 0; i < size; i++) { for(j = i; j < size; j++) { if(base[i] > base[j]) { temp = base[i]; base[i] = base[j]; base[j] = temp; } } } } Абстракция
int main() { int array[] = {1, 9, 5, 4,
7, 2, 4, 6}; size_t length = sizeof(array)/sizeof(int); bubble_sort(array, length); size_t i; for(i = 0; i < length; i++) { printf("%d ", array[i]); } printf("\n"); return 0; }
void qsort(void *base, size_t nmemb, size_t size, int(*compar)(const void *,
const void *)); int greater_than(const void* pleft, const void* pright) { int left = *(int*) pleft; int right = *(int*) pright; return left > right; } qsort(array, length, sizeof(int), greater_than);
int less_than(const void* pleft, const void* pright) { int left
= *(int*) pleft; int right = *(int*) pright; return left < right; } qsort(array, length, sizeof(int), less_than);
void (*signal(int, void(*)(int)))(int); Ужасы языка С
typedef void (*signal_handler)(int signum); void (*signal(int, void(*)(int)))(int); signal_handler signal(int signum,
signal_handler handler);