From 8914bb779e485ffcd6b06b9f4bc9ca8b04bf91e2 Mon Sep 17 00:00:00 2001 From: gitee-bot Date: Tue, 5 Aug 2025 10:44:45 +0000 Subject: [PATCH] Update README.md --- README.en.md | 69 ++++++++++++++++++++++++++++++++++++++++++++++++++ README.md | 71 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 140 insertions(+) create mode 100644 README.en.md create mode 100644 README.md diff --git a/README.en.md b/README.en.md new file mode 100644 index 0000000..99d5428 --- /dev/null +++ b/README.en.md @@ -0,0 +1,69 @@ +# C Language Pointer Example Projects + +This repository contains several simple C language projects that primarily demonstrate the basic usage of pointers. + +## Project Structure + +``` +├── C_Pointer1 +│ └── pointer.c # Pointer basics example +├── C_Pointer2 +│ └── pointer2.c # Pointer swap function example +└── C_pointer3 + └── pointer3.c # Basic pointer example with macro definitions +``` + +## Project Overview + +### C_Pointer1 +This is a simple pointer example that demonstrates how to use pointers. + +### C_Pointer2 +This project contains an example of a pointer-based swap function, showing how pointers can be used as function parameters to exchange the values of two variables. + +### C_pointer3 +This is another basic pointer example that demonstrates pointer usage along with macro definitions. + +## Installation Instructions + +This project is built using Microsoft Visual Studio. You need to install Visual Studio to open the project files. + +## Usage + +1. Open the corresponding .sln file (e.g., C_Pointer1.sln, C_Pointer2.sln, C_pointer3.sln). +2. Select the appropriate configuration (Debug/Release) and platform (x64). +3. Build the solution. +4. Run the generated executable file (e.g., C_language_Pointer.exe, C_Pointer2.exe, C_pointer3.exe). + +## Code Examples + +### Basic Pointer Usage + +Basic pointer usage examples are included in pointer.c and pointer3.c. + +```c +int main() +{ + // Pointer usage example +} +``` + +### Swapping Variables Using Pointers + +pointer2.c contains a function that swaps two integers using pointers. + +```c +int Swap2(int* px, int* py) +{ + // Swap the values of two integers using pointers +} + +int main() +{ + // Main function +} +``` + +## License + +This project is licensed under the MIT License. For details, please refer to the LICENSE file located in the root directory of the project. \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..216db0f --- /dev/null +++ b/README.md @@ -0,0 +1,71 @@ + + +# C语言指针示例项目 + +本仓库包含多个简单的C语言项目,主要演示了指针的基本用法。 + +## 项目结构 + +``` +├── C_Pointer1 +│ └── pointer.c # 指针基础示例 +├── C_Pointer2 +│ └── pointer2.c # 指针交换函数示例 +└── C_pointer3 + └── pointer3.c # 指针基础示例,包含宏定义 +``` + +## 项目介绍 + +### C_Pointer1 +这是一个简单的指针示例,展示了如何使用指针。 + +### C_Pointer2 +这个项目包含一个指针交换函数的示例,展示了如何使用指针作为函数参数来交换两个变量的值。 + +### C_pointer3 +这是另一个指针基础示例,展示了如何使用指针以及宏定义。 + +## 安装说明 + +本项目使用Microsoft Visual Studio构建,您需要安装Visual Studio以打开项目文件。 + +## 使用方法 + +1. 打开对应的.sln文件(如C_Pointer1.sln, C_Pointer2.sln, C_pointer3.sln)。 +2. 选择适当的配置(Debug/Release)和平台(x64)。 +3. 构建解决方案。 +4. 运行生成的exe文件(如C_language_Pointer.exe, C_Pointer2.exe, C_pointer3.exe)。 + +## 代码示例 + +### 指针基础用法 + +pointer.c 和 pointer3.c 中都包含了基本的指针用法示例。 + +```c +int main() +{ + // 指针用法示例 +} +``` + +### 使用指针交换变量 + +pointer2.c 包含了一个使用指针交换两个整数的函数。 + +```c +int Swap2(int* px, int* py) +{ + // 使用指针交换两个整数的值 +} + +int main() +{ + // 主函数 +} +``` + +## 许可证 + +本项目采用MIT许可证。详情请查看项目根目录下的LICENSE文件。 \ No newline at end of file -- Gitee