STL stands for Standard Template Library. It provides common programming data structures and algorithms. The key components of STL are containers like vector and list that store data, iterators that access elements in containers, and algorithms that perform operations on data structures. STL aims to provide generic functions that work on different data types through templates. Common STL algorithms include searching, sorting, copying, and erasing elements from containers.
This document discusses various aspects of functions in C++ including function prototypes, definitions, calls, overloading, pointers, callbacks, and templates. It provides examples and explanations of each concept. The key topics covered are:
- Function prototypes declare a function's name, return type, and parameters.
- Definitions implement what a function does through code within curly braces.
- Functions are called by name with appropriate arguments.
- Overloading allows different functions to have the same name based on different parameters.
- Function pointers allow functions to be passed as arguments to other functions.
- Callback functions are functions that are passed as arguments to be called later.
- Templates define functions that operate on different data
This document discusses file input/output (I/O) functions in C, including opening, reading from, and writing to files. It covers FILE pointers, opening and closing files, functions for modifying the file position indicator, error handling, and other common file operations like removing and renaming files. The functions described provide a way for C programs to perform input and output to files on the disk.
This document provides an overview of basic Windows programming concepts, including:
- Windows applications are event-driven and message-based, utilizing messages to communicate between components. System-defined and application-defined messages are described.
- The typical steps for creating a window are outlined as registering the window class, creating the window, entering the message loop, and processing messages in the window procedure.
- Resources, dynamic link libraries, the first Windows programs, and numeric identifiers are also briefly covered. Examples of common Windows messages like WM_PAINT and WM_DESTROY are given.
This document provides an introduction to Android programming, including the necessary tools like Eclipse and the Android SDK. It discusses setting up the Android developer tools plugin in Eclipse, creating Android applications, and the anatomy of an Android project structure. The document also covers common Android layouts like linear, relative, grid and list views. It introduces the Android activity lifecycle and describes how activities transition between different states.
STL stands for Standard Template Library. It provides common programming data structures and algorithms. The key components of STL are containers like vector and list that store data, iterators that access elements in containers, and algorithms that perform operations on data structures. STL aims to provide generic functions that work on different data types through templates. Common STL algorithms include searching, sorting, copying, and erasing elements from containers.
This document discusses various aspects of functions in C++ including function prototypes, definitions, calls, overloading, pointers, callbacks, and templates. It provides examples and explanations of each concept. The key topics covered are:
- Function prototypes declare a function's name, return type, and parameters.
- Definitions implement what a function does through code within curly braces.
- Functions are called by name with appropriate arguments.
- Overloading allows different functions to have the same name based on different parameters.
- Function pointers allow functions to be passed as arguments to other functions.
- Callback functions are functions that are passed as arguments to be called later.
- Templates define functions that operate on different data
This document discusses file input/output (I/O) functions in C, including opening, reading from, and writing to files. It covers FILE pointers, opening and closing files, functions for modifying the file position indicator, error handling, and other common file operations like removing and renaming files. The functions described provide a way for C programs to perform input and output to files on the disk.
This document provides an overview of basic Windows programming concepts, including:
- Windows applications are event-driven and message-based, utilizing messages to communicate between components. System-defined and application-defined messages are described.
- The typical steps for creating a window are outlined as registering the window class, creating the window, entering the message loop, and processing messages in the window procedure.
- Resources, dynamic link libraries, the first Windows programs, and numeric identifiers are also briefly covered. Examples of common Windows messages like WM_PAINT and WM_DESTROY are given.
This document provides an introduction to Android programming, including the necessary tools like Eclipse and the Android SDK. It discusses setting up the Android developer tools plugin in Eclipse, creating Android applications, and the anatomy of an Android project structure. The document also covers common Android layouts like linear, relative, grid and list views. It introduces the Android activity lifecycle and describes how activities transition between different states.
This document provides an overview of how to program. It discusses key programming elements like data types, control structures, algorithms, and data structures. It also covers tools like Eclipse and languages like Java. The document gives examples of programming problems and their solutions, including examples to find prime numbers and print patterns like diamonds. It discusses debugging, version control with Git, and object-oriented programming concepts. The document is intended to teach someone the basic concepts and process of programming.
The document discusses generic programming and the Standard Template Library (STL) in C++. It provides an overview of key concepts in generic programming like class templates and how templates allow for reusability. It also covers STL containers, iterators, algorithms and other common components. Specific examples are given around stacks, arrays, and multiple inheritance to demonstrate how templates and generic programming work.
This document discusses object-oriented programming concepts including inheritance, polymorphism, and operator overloading. It provides examples of defining a Complex class with operator overloading, inheriting from a TableTennisPlayer class to create a RatedPlayer class, and using virtual functions and dynamic binding. Inheritance allows defining is-a relationships between classes. Polymorphism is demonstrated through virtual functions that can be redefined in derived classes.
Control Flow Statements
Last Week Homework "Stack" Solution
Function pointer (函式指標)
Static Class Members (靜態類別成員)
Constructor & Destructor (建構子與解構子)
Class Templates (類別樣板)