Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions cn/examples/section_1/comment.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
---
version: 1.0.0
example_title: 注释
---

# 注释

V支持单行注释`//`和多行注释`/**/`。
Expand Down
5 changes: 5 additions & 0 deletions cn/examples/section_1/hello_world.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
---
version: 1.0.0
example_title: 格式化打印
---

# 格式化打印

打印由各种I/O流函数处理。人们应该要知道如何去使用它们。
Expand Down
5 changes: 5 additions & 0 deletions cn/examples/section_1/keywords.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
---
version: 1.0.0
example_title: 关键字
---

# 关键字

V是一种非常小巧的语言,所以它很少有关键字。大约有25个关键字。
Expand Down
5 changes: 5 additions & 0 deletions cn/examples/section_1/primitives.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
---
version: 1.0.0
example_title: Primitives
---

# Primitives

V的基本类型比Go少。
Expand Down
5 changes: 5 additions & 0 deletions cn/examples/section_1/strings.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
---
version: 1.0.0
example_title: 字符串
---

# 字符串

在V中,可以使用`:=`运算符定义字符串。默认情况下,字符串(与其他变量一样)是不可变的。
Expand Down
5 changes: 5 additions & 0 deletions cn/examples/section_1/variables.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
---
version: 1.0.0
example_title: 变量
---

# 变量

在V语言中,变量可以用`:=`运算符声明和初始化。变量只能以这种方式在V中声明,这意味着所有变量都有一个初始值。变量的类型是从右边的值推断出来的。默认情况下,V中的变量是不可变的。
Expand Down
5 changes: 5 additions & 0 deletions cn/examples/section_2/if-else.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
---
version: 1.0.0
example_title: If语句
---

# If语句

## `if` 表达式
Expand Down
5 changes: 5 additions & 0 deletions cn/examples/section_2/loops.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
---
version: 1.0.0
example_title: 循环结构
---

# 循环结构

在V语言中只有一种类型的循环,像Go一样,它可以在很多方面使用。
Expand Down
5 changes: 5 additions & 0 deletions cn/examples/section_2/match.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
---
version: 1.0.0
example_title: Match
---

# Match

## match语句
Expand Down
5 changes: 5 additions & 0 deletions cn/examples/section_2/operator.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
---
version: 1.0.0
example_title: 运算符
---

# 运算符

V支持以下运算符:
Expand Down
5 changes: 5 additions & 0 deletions cn/examples/section_3/arrays.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
---
version: 1.0.0
example_title: 数组
---

# 数组

数组是存储在连续内存位置的项的集合。它是一个聚合数据结构,旨在存储一组相同类型的对象。它是存储和访问一系列对象的最有效的数据结构。
Expand Down
5 changes: 5 additions & 0 deletions cn/examples/section_3/functions.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
---
version: 1.0.0
example_title: Functions
---

# Functions

函数是一个有组织、可重用的代码块,用于执行单个相关操作。
Expand Down
5 changes: 5 additions & 0 deletions cn/examples/section_3/methods.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
---
version: 1.0.0
example_title: Methods
---

# Methods

V没有Class。但是可以为类型定义方法。
Expand Down
5 changes: 5 additions & 0 deletions cn/examples/section_3/struct.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
---
version: 1.0.0
example_title: Struct
---

# Struct

struct是一种复合数据类型(或记录)声明,它在内存块中的一个名称下定义物理分组的变量列表,允许通过单个指针或通过返回相同地址的struct声明的名称访问不同的变量。
Expand Down
5 changes: 5 additions & 0 deletions cn/examples/section_4/array-functions.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
---
version: 1.0.0
example_title: 数组函数
---

# 数组函数

## `repeat`
Expand Down
7 changes: 6 additions & 1 deletion cn/examples/section_4/files.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
---
version: 1.0.0
example_title: 文件操作
---

# 文件操作

V中的文件是程序可访问的任何文件对象的抽象,与`os`库密切相关。
Expand Down Expand Up @@ -76,4 +81,4 @@ fn read_file(path string) {
1.编写一个V程序来创建一个包含内容的新文件。
2.编写一个V程序来读取两个不同的文件并显示其内容。
3.阅读V中“os”库的工作原理,了解如何使用它。
4.编码一个嵌套的json字符串并用结果编写一个新文件。
4.编码一个嵌套的json字符串并用结果编写一个新文件。
5 changes: 5 additions & 0 deletions cn/examples/section_4/testing.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
---
version: 1.0.0
example_title: 测试
---

# 测试

软件开发中的测试是一个过程,其目的是评估应用程序的功能,以确定代码是否满足指定的要求,并确定问题,以确保产品具有预期的质量。
Expand Down