- Главная
- Информатика
- Module 1: Functions and Organization. Topic 1.1: Why Use Functions?
Содержание
Слайд 2
What is a Function
A set of instructions with a name (usually)
func
What is a Function
A set of instructions with a name (usually)
func
main() {
fmt.Printf("Hello, world.")
}
fmt.Printf("Hello, world.")
}
func PrintHello() {
fmt.Printf("Hello, world.")
}
func main() {
PrintHello()
}
Function declaration, name, call
Слайд 3
Reusability
You only need to declare a function once
Good for commonly used
Reusability
You only need to declare a function once
Good for commonly used
operations
Graphics editing program might have ThresholdImage()
Database program might have QueryDbase()
Music program might have ChangeKey()
Graphics editing program might have ThresholdImage()
Database program might have QueryDbase()
Music program might have ChangeKey()
- Предыдущая
Валовой продукт. Индексы ценСледующая -
Советы педагога-психолога