共有 5 篇文章
2024-08-15
Problem Solving With C++ Note: Function
2024-08-15 ~ 2024-08-16
cpp
Functions In C++ and most modern programming languages, we may put statements into functions to be invoked in the future. Also known as procedures in some languages. Why functions We need modules instead of a huge main function. Easier to divide the works: modularization. Easier to debug: mantenance. Easier to maintain consistency. We need something that can be used repeatedly. Enhance resuability Structure of functions In C++, a function is composed of a header and body. A header for declaration:
2024-07-16
Problem Solving with C++ Note: Variables and Arrays
2024-07-16 ~ 2024-07-16
cpp
Introduction Arrays A collection of variables of the same type. An array variable is of an array type, a non-basic data type There are many non-basic data types: Arrays Pointers. Self-defined types. … Basic data types In C++, each variable must be have its data type It tells the system how to allocate memory spaces and how to interpret those 0s and 1s stored there. It will also determine how operations are performed on the variable. Basic (or build-iun or
2024-07-12
Problem Solving with C++ Note: Selection and Repetition
2024-07-12 ~ 2024-07-12
cpp
Preprocessors Preprocessor commands, which begins with #, performs some actions before the complier does the translation. The include command is to include a header file: Files containing definitions of common variables and functions. Written to be included by other programs. #include <iostream>: Before the compilation, the complier looks for the iostream header file and copy the codes therein to replace this line. We may define our own variables and functions into self-defined header files and include them by ourselves: #include "myHeader" Use double quotation marks instead of angle brackets.
2024-05-23
Problem Solving with C++ Note: Introdution
2024-05-23 ~ 2024-07-12
cpp
Reference http://www.im.ntu.edu.tw/~lckung/teaching-page.html https://www.youtube.com/watch?v=4H3b5wATFos&amp;list=PLMHSr8fseBzUvwjKtR6pX0Vv9Q9H-V3lY&amp;index=1 Introduction What are computer programs The elements working in computers Also known as software A Structured combination of data and instructions used to operate a computer to produce a specific result Programming languages People and computers talk in programming languages. A programming language may be a machine language, and assembly language, or a high-level language (or something else) Machine and assembly languages: Control the hardware directly, but hard to read and program. High-level languages: Easy to read and program, but need a “translator”.
2024-05-20
Cpp 编译环境配置
2024-05-20 ~ 2024-08-16
cpp
Installing Complier (Windows) GCC scoop install main/gcc LLVM scoop install main/llvm MS Install Visual Studio Visual Studio Settings How to Setup C++ on Windows 当使用 Visual Studio 管理多个项目时,为了避免编译过程中的文件冲突,建议为每个项目单独设置输出目录(Output Direct