BP (Basic Programming)
文章平均质量分 79
Fundamentals of Programming using C++/C#
Jacy_CSer
南京大学计算机科学与技术系
展开
-
BP-5-9 Pointer and Array and Reference Type
Chapter 05 Compound Data Type - Constructed Type5.4 Pointer and ArrayThe name of an array is a constant pointer pointed at the first element of the array whose value is the address of the first element of an array.Arrays with more than one dimensions c原创 2021-01-30 04:25:29 · 170 阅读 · 0 评论 -
BP-5-8 Pointer for a Function
Chapter 05 Compound Data Type - Constructed Type5.5 Pointer for a FunctionDefinition<return-type> (*<pointer>) (<parameter-list>);//ortypedef <return-type> (*<type-name>) (<parameter-list>);<type-name> <原创 2021-01-30 04:25:20 · 72 阅读 · 0 评论 -
BP-5-7 Linked List
Chapter 05 Compound Data Type - Constructed Type4. Application - Linked ListLinked List is a linear data structure, whose implementation is a structure type containing a pointer whose base type is itself as its member. The data is stored in the structur原创 2021-01-30 04:25:07 · 143 阅读 · 0 评论 -
BP-5-6 Dynamic Variable and Dynamic Array
5.3 Dynamic Variable1. Creationnew <type-name>Keyword new allocates room in the heap to a dynamic variable and return its address as a pointer, and if you want to use it later, you must use a pointer to store it.new <type-name> [inte原创 2021-01-30 04:24:53 · 93 阅读 · 0 评论 -
BP-5-5 Pointer Type - Description of Address in Memory
Chapter 05 Compound Data Type - Constructed Type5. Pointer Type - Description of Address in MemoryPointer Type is a user-defined data type used to describe addresses in the memory. As has been introduced before, we can call anything in the program eithe原创 2021-01-30 04:24:40 · 111 阅读 · 0 评论 -
BP-5-4 Union Type
Chapter 05 Compound Data Type - Constructed Type4. Union TypeUnion Type is a kind of compound data type that can represent several types of data. As we known, each data has its unique type and the memory will allocate to it a corresponding kind of room原创 2021-01-30 04:24:27 · 174 阅读 · 1 评论 -
BP-5-3 Structure Type
Chapter 05 Compound Data Type - Constructed Type3. Structure TypeStructure type is a kind of compound data type constructed by the user, which is composed of several members known as its member.3.1 Definition of Structure Typestruct <name-of-struc原创 2021-01-30 04:24:14 · 115 阅读 · 0 评论 -
BP-5-2 Array Type
Chapter 05 Compound Data Type - Constructed Type2. Array TypeArray Type is a user-defined compound data type to describe a sequence of elements.2.1 Single Dimensional ArraySingle dimensional array can describes data structure called linear list.D原创 2021-01-30 04:23:57 · 122 阅读 · 0 评论 -
BP-5-1 Enumeration Type
Chapter 05 Compound Data Type - Constructed Type1. Enumeration TypeType Constructionenum <enumeration-type-name> {<enumerration-value-list>};Enumeration type name is an identifier, which identifies the name of an enumeration type, which原创 2021-01-29 00:30:40 · 122 阅读 · 0 评论 -
BP-4-5 Further Discussion on C++ Functions
Chapter 04 Procedural Abstraction - Function6. Further Discussion on C++ Functions6.1 Macro with Parameters#define <macro-name> (<parameter-list>) <expression>//example:#define max(a, b) (((a) > (b)) ? (a) : (b))Macro is inheri原创 2021-01-29 00:30:16 · 71 阅读 · 0 评论 -
BP-4-4 Recursive Function
Chapter 04 Procedural Abstraction - Function5. Recursive FunctionA recursive function is a function that calls itself directly or indirectly in its body.5.1 Divide and ConquerWhen defining a recursive function, we must clarify general case and base原创 2021-01-29 00:29:59 · 156 阅读 · 0 评论 -
BP-4-3 Scope and Lifetime
Chapter 04 Procedural Abstraction - Function4. Scope and Lifetime4.1 Multi-Module StructureA module is made up of several relevant definitions of program bodies. And a module usually consists of two parts:Module interface gives some definition and原创 2021-01-29 00:29:41 · 85 阅读 · 0 评论 -
BP-4-2 Function
Chapter 04 Procedural Abstraction - Function3. Function3.1 Function Definition<type-of-return-value> <function-name> (<parameter-list>) <function-body><type-of-return-value> describes the data type the function will retu原创 2021-01-29 00:29:02 · 125 阅读 · 0 评论 -
BP-4-1 Sub-Program
Chapter 04 Procedural Abstraction - Function1. General DescriptionWhen people design a complex program, they usually uses the method of function decomposition and function mix.Function decomposition refers to designing a program in a top-down and s原创 2021-01-29 00:28:51 · 80 阅读 · 0 评论 -
BP-3-4 Unconditional Jump and Programming Style
Chapter 03 Control Flow5. Unconditional Jump5.1 Goto Statementgoto <statement-label>;......<statement-label>: <statements>; //here statements is called labeled-statementgoto means jumping to the labeled-statement corresponding to原创 2021-01-29 00:28:37 · 120 阅读 · 0 评论 -
BP-3-3 Examples of Iteration
Chapter 03 Control Flow4.5 Examples of IterationThe problems below might be easy, so try your best to make your solution easier and simpler.Fibonacci#include <iostream>using namespace std;int main(){ int n; cin >> n; int fib原创 2021-01-29 00:28:25 · 54 阅读 · 0 评论 -
BP-3-2 Loop Control
Chapter 03 Control Flow4. Loop ControlA loop control usually contains four parts:Loop initializationLoop conditionLoop bodyNext loop preparationPlease always remember to check the loop condition and next loop preparation so that your loop can end原创 2021-01-29 00:28:16 · 197 阅读 · 3 评论 -
BP-3-1 Selection Control
Chapter 03 Control Flow1. AlgorithmAlgorithm describes the control of the flow, such as which expression computes first, whether to compute some expressions or repeating computing some expressions several times.We use statement to describe and implemen原创 2021-01-29 00:28:06 · 84 阅读 · 0 评论 -
BP-2-5 Basic Computation of Data - Expressions
Chapter 02 Description of Simple Data6. Basic Computation of Data - Expressions6.1 Component of ExpressionExpression consists of operators, operands and parentheses, which make up the primitive computation unit in a program.Constants and Variables原创 2021-01-28 00:59:55 · 88 阅读 · 0 评论 -
BP-2-4 Type Conversion of Operands
Chapter 02 Description of Simple Data5. Type Conversion of Operands5.1 Implicit Type ConversionUsual Arithmetic ConversionsIn arithmetic expressions, operands of different data type in the same expression will be conversed to the same data type, whi原创 2021-01-28 00:57:09 · 89 阅读 · 0 评论 -
BP-1-1 The working Model of Computer
Chapter 01 Introduction of Programming1. The Working Model of Computer1.1 Von Neumann Structure1.2 The Component of ComputerA computer is composed of hardware and software. If hardware is the blood and flesh of a computer, the software is its soul.T原创 2021-01-28 00:43:39 · 211 阅读 · 0 评论 -
BP-2-3 Operator
Chapter 02 Description of Simple Data4. OperatorOperator describes basic operation on data, which is also called operand(s).Operands can be both variables or constants or expressions that evaluate to a value.In C++, some operator will change the value原创 2021-01-28 00:48:07 · 154 阅读 · 0 评论 -
BP-2-2 Forms of Data
Chapter 02 Description of Simple Data3. Forms of DataIn a program, data usually appears as constant or variable.3.1 ConstantConstant refers to the data which remains the same or can’t be modified during the execution of the program.1. literalli原创 2021-01-28 00:47:05 · 119 阅读 · 0 评论 -
BP-2-1 Fundamental Data Type
Chapter 02 Description of Simple Data1. Data TypeData type is composed of value set and operation set and can be divided into primitive data type and compound data type.In terms of the requirement of declaration on data type, programming language can原创 2021-01-28 00:45:47 · 116 阅读 · 0 评论 -
BP-1-3 Introduction of C++
Chapter 01 Introduction of Programming3. Introduction of C++A C++ program must have a function named main defined in only one source document.3.1 Lexer in C++symbol setlettersnumbersspecial characterswordIdentifier is composed of letter原创 2021-01-28 00:45:22 · 124 阅读 · 4 评论 -
BP-1-2 Programming
Chapter 01 Introduction of Programming2. Programming2.1 Programming ParadigmImperative programming emphasizes how to do it and gives the computer explicit descriptions of the definite and specific procedure.Procedural programmingObject-oriented p原创 2021-01-28 00:44:49 · 109 阅读 · 0 评论