Kinh doanh - Marketing
Kinh tế quản lý
Biểu mẫu - Văn bản
Tài chính - Ngân hàng
Công nghệ thông tin
Tiếng anh ngoại ngữ
Kĩ thuật công nghệ
Khoa học tự nhiên
Khoa học xã hội
Văn hóa nghệ thuật
Sức khỏe - Y tế
Văn bản luật
Nông Lâm Ngư
Kỹ năng mềm
Luận văn - Báo cáo
Giải trí - Thư giãn
Tài liệu phổ thông
Văn mẫu
Tài liệu HOT
Tìm
Danh mục
Kinh doanh - Marketing
Kinh tế quản lý
Biểu mẫu - Văn bản
Tài chính - Ngân hàng
Công nghệ thông tin
Tiếng anh ngoại ngữ
Kĩ thuật công nghệ
Khoa học tự nhiên
Khoa học xã hội
Văn hóa nghệ thuật
Y tế sức khỏe
Văn bản luật
Nông lâm ngư
Kĩ năng mềm
Luận văn - Báo cáo
Giải trí - Thư giãn
Tài liệu phổ thông
Văn mẫu
Thông tin
Điều khoản sử dụng
Quy định bảo mật
Quy chế hoạt động
Chính sách bản quyền
0
Trang chủ
Công Nghệ Thông Tin
Cơ sở dữ liệu
Generic programming
TAILIEUCHUNG - Generic programming
Generic programming Generic programming is about generalizing software components so that they can be easily reused in a wide variety of situations; As a simple example of generic programming, the memcpy function of the C standard library is a generic function to copy data from a container to another. | Generic programming anhtt-fit@ dungct@ Introduction Generic programming is about generalizing software components so that they can be easily reused in a wide variety of situations. As a simple example of generic programming, the memcpy() function of the C standard library is a generic function to copy data from a container to another. void* memcpy(void* region1, const void* region2, size_t n); The memcpy() function is already generalized to some extent by the use of void* so that the function can be used to copy arrays of different kinds of data. Generally, to copy data we need to know only the address and the size of the container to copy. 1 memcpy An implementation of memcpy() might look like the following: void* memcpy(void* region1, const void* region2, size_t n) { const char* first = (const char*) region2; const char* last = ((const char*) region2) + n; char* result = (char*) region1; while (first != last) *result++ = *first++; return result; } Generic functions In a generic function, data should be passed in a generic way (by address and size). If the algorithm demands a specific function to manipulate data (, compare two values), such a function should be passed using a function pointer. Example: A generic search function on an array. How to pass data to this function ? How the algorithm can detect if two data items in the array is equal or not ? 2 Implementation (1) A generic data array should be passed as the following parameters void * buf: the address of the buffer containing the array’s data int size: the size of a data item in the array int total: the total number of data items in the array The search algorithm need also a function to compare the data items in the array for searching. A data item passed to such a function via its address. Use a function pointer to represent a generic comparison algorithm. int (*compare) (void * item1, void * item2) Implementation (2) // return -1 if not found int search( .
Ðức Cường
51
11
pdf
Báo lỗi
Trùng lắp nội dung
Văn hóa đồi trụy
Phản động
Bản quyền
File lỗi
Khác
Upload
Tải xuống
đang nạp các trang xem trước
Bấm vào đây để xem trước nội dung
Tải xuống
TÀI LIỆU LIÊN QUAN
Object Oriented Programming - Lesson 8: Polymorphism and generic programming
46
57
0
Lecture Java™ How to Program (8/e) - Chapter 20: Generic collections
102
50
0
Introduction to java programming: Chapter 21 - Generics
16
88
0
Generic programming
11
38
0
Lecture Object-Oriented programming - Lesson 34: Generic algorithms
22
7
1
The Managed Provider and Generic Data Set Classes
8
49
0
Lecture Object-Oriented programming - Lesson 39: Templates & Static members
22
12
1
Lecture Object-Oriented programming - Lesson 40: Cursors
31
7
1
Ebook Fundamentals of C++ programming: Part 2
349
78
0
Book: ANSI/ISO C++ Professional Programmer's Handbook
281
50
0
TÀI LIỆU XEM NHIỀU
Một Case Về Hematology (1)
8
461942
55
Giới thiệu :Lập trình mã nguồn mở
14
23112
64
Tiểu luận: Tư tưởng Hồ Chí Minh về xây dựng nhà nước trong sạch vững mạnh
13
10987
531
Câu hỏi và đáp án bài tập tình huống Quản trị học
14
10183
451
Phân tích và làm rõ ý kiến sau: “Bài thơ Tự tình II vừa nói lên bi kịch duyên phận vừa cho thấy khát vọng sống, khát vọng hạnh phúc của Hồ Xuân Hương”
3
9572
106
Ebook Facts and Figures – Basic reading practice: Phần 1 – Đặng Tuấn Anh (Dịch)
249
8385
1132
Tiểu luận: Nội dung tư tưởng Hồ Chí Minh về đạo đức
16
8278
423
Mẫu đơn thông tin ứng viên ngân hàng VIB
8
7889
2228
Đề tài: Dự án kinh doanh thời trang quần áo nữ
17
6836
256
Giáo trình Tư tưởng Hồ Chí Minh - Mạch Quang Thắng (Dành cho bậc ĐH - Không chuyên ngành Lý luận chính trị)
152
6115
1473
TỪ KHÓA LIÊN QUAN
Cơ sở dữ liệu
Generic programming
Generic functions
Initializing a structure with a function pointer
Constructor functions
Access functions
Object Oriented Programming
Polymorphism technique
Java generic programming
Method call binding
Java program
Generic collections
Generic methods
Overloading generic methods
Generic classes
Introduction to java programming
Generic Type
Generic ArrayList in JDK 1
Fix the Warning
No Casting Needed
Declaring Generic Classes
Lecture Object Oriented programming
Bài giảng Lập trình hướng đối tượng
Generic algorithms
Increment operator (++)
Dereference operator (*)
kĩ thuật lập trình
công nghệ thông tin
lập trình
ngôn ngữ lập trình
C Shark
C#
sybex c
sharp database programming
The Managed Provider and Generic Data Set Classes
Templates members
Static members
Generic algorithms revisited
Inequality operator (!=)
Generic algorithm
Container traversal operations
Aggregate object
Fundamentals of C++ programming
Standard C++ classes
Custom objects
Fine tuning objects
Building some useful classes
Memory management
C++
Operator Overloading
RTTI
Language Features
Designing Class Hierarchies
Lập trình hướng đối tượng
Standard Template Library
Origins of STL
STL components
TÀI LIỆU MỚI ĐĂNG
Giáo án mầm non chương trình đổi mới: Đề tài: Ôn xác định vị trí trên – dưới, trước- sau của đối tượng khác.
8
373
3
21-05-2024
extremetech Hacking BlackBerry phần 9
31
263
0
21-05-2024
Trading Strategies Profit Making Techniques For Stock_8
23
187
1
21-05-2024
Posted prices versus bargaining in markets_7
23
166
0
21-05-2024
B2B Content Marketing: 2012 Benchmarks, Budgets & Trends
17
147
0
21-05-2024
Diseases of the Liver and Biliary System - part 1
33
139
0
21-05-2024
XỬ TRÍ CHẤN THƯƠNG SỌ NÃO KÍN
1
124
1
21-05-2024
báo cáo hóa học:" Increased androgen receptor expression in serous carcinoma of the ovary is associated with an improved survival"
6
108
0
21-05-2024
A Practical Guide for Health Researchers - part 7
24
115
0
21-05-2024
MẪU CHỨNG CHỈ QUẢN LÝ VŨ KHÍ, VẬT LIỆU NỔ, CCHT
1
128
0
21-05-2024
TÀI LIỆU HOT
Mẫu đơn thông tin ứng viên ngân hàng VIB
8
7889
2228
Giáo trình Tư tưởng Hồ Chí Minh - Mạch Quang Thắng (Dành cho bậc ĐH - Không chuyên ngành Lý luận chính trị)
152
6115
1473
Ebook Chào con ba mẹ đã sẵn sàng
112
3788
1255
Ebook Tuyển tập đề bài và bài văn nghị luận xã hội: Phần 1
62
5413
1138
Ebook Facts and Figures – Basic reading practice: Phần 1 – Đặng Tuấn Anh (Dịch)
249
8385
1132
Giáo trình Văn hóa kinh doanh - PGS.TS. Dương Thị Liễu
561
3552
656
Giáo trình Sinh lí học trẻ em: Phần 1 - TS Lê Thanh Vân
122
3757
544
Tiểu luận: Tư tưởng Hồ Chí Minh về xây dựng nhà nước trong sạch vững mạnh
13
10987
531
Giáo trình Pháp luật đại cương: Phần 1 - NXB ĐH Sư Phạm
274
4170
523
Bài tập nhóm quản lý dự án: Dự án xây dựng quán cafe
35
4191
483
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.