Golang 快速學習自我挑戰 Day14
Section14: Methods: OOP with Go Methods:Enhance types with additional behavior Methods Value Receivers Pointer Receivers Non-Struct Methods Interface Type Assertion Type Switch Empty Interface
Section14: Methods: OOP with Go Methods:Enhance types with additional behavior Methods Value Receivers Pointer Receivers Non-Struct Methods Interface Type Assertion Type Switch Empty Interface
Section 24: C++ 11 Auto auto can detect the data type, so you don’t need to declare the data type by yourself. decltype can capture the data type and use it on the other variables. 1234567891011121
Section 22: I/O Streams Streams Stream is a flow of data or flow of characters. Streams are used for accessing the data from outside program. Here are the types of stream. istream: cin >> os
Section 19: Template Functions and Classes Template Functions and Classes Template is used for multiple data types. Here is an example. 1234567891011121314151617181920212223242526272829303132333435
Section 16: Polymorphism Function Overriding Function overriding is you can redefined the parent function in the child class. You use the same function name of the parent class in child class. Exam
Section 13: Operator Overloading Operator Overloading Operators: +, *, -, (), ++, new, delete… These operators can be used for primary data types, such as int, float… If we want to perform these op
Section 12: Introduction to OOPS Principles of Object-Oriented Programming Abstraction: We use class to abstract the object, and put data and function inside the class. We don’t need to see content
Section11: Functions Introduction return-Type Function-name(Parameter List). Should not use cin and cout inside function. Add function example. 12345678910111213141516171819202122#include <iostr
Section 10: String Class String You need to include string library to use string. Also, you can use getline to get the string from the user input. 12345678910111213141516#include <iostream>#i
Section 9: Pointers Introduction Two types of variables. data variable. For example, int x = 10;. address variable. For example, int *p; p = &x; Example 1234567// x, value 10, address 200/20
Section 7: Loops Loops - Iterative Statement while 123while (<condition>) { process;} do while 123do { process;} while (<condition>) Print the numbers example.
Section 5: C++ Basics Compound Assignment +=, -=, *=, /=, %=. &=, |=, <<=, >>=. example 12345678910int a = 10, b = 5, c = 15;int sum;sum = sum + a + b + c;// simplifysum += a + b +
Section 2: Essential Fundamentals How computer works? CPU have two parts, ALU(Arithmetic Logic Unit) and CU(Control Unit). A computer can perform arithmetic operations like +, -, *, / and logical o
第十三章:Functions, Pointers 和 Addressability 學習 Function 的基礎 Function 用 func 這個 keyword,init 和 main 是特殊名字,不用在 Function 的名字使用它們。 一個 Function 可以有零到多個輸入參數,func sum(a int, b int) {} 和 func sum(a
第十二章:Structs:Encode 和 Decode JSON 什麼是 Struct? Struct 就像 blueprint。 Struct 就像 OOP 語言裡面的 class。 Struct 可以將相關的資料組裝成一個單一型別。 Struct 在 compile-time 是固定的,所以在 runtime 的時候不能新增 field。 Struct 可儲存不同型別的資料。 Stru
第五章:Slices 和 Internal 完整的 Slice 表達式:限制 Slice 的 capacity newSlice := sliceable[START:STOP:CAP],CAP 可以限制回傳的 Slice capacity。 stop position <= capacity position,停止的位置必定小於等於 capacity 的位置。 123456789sl