c语言的实验,c语言实验

入实验一 Functions and Program Structure

实验要求:必做

1. 掌握C语言的函数的定义;

2. 学会C函数的语法结构,会用C语言实现函数的功能;

3. 回顾C语言基础部分的学习。

实验内容:

1.了解和使用VC集成开发环境

2.熟悉VC环境的基本命令和功能键,熟悉常用的功能菜单命令

3.学习使用C语言实现函数的编写

4.理解函数的调用过程

实验题目:

1. Write the function fun, which computes the result of, and use the main function to call this function for testing.

2. Write the function strrindex (s, t), which returns the position of the rightmost occurrence of t in s, or -1 if there is none.

编写一个函数strrindex(s, t),用于返回字符串t在s中最右出现的位置,如果s中不

包含t,那么返回-1。

3. Imitating the function atoi, which can convert the numeric string to an integer?

实验二 Point and Arrays

实验要求:必做

1. 掌握数组的概念和使用方法

2. 掌握数组的初始化方法

3. 会用字符数组处理字符串

4. 了解数组名作函数参数

5. 掌握指针变量的定义,会使用指针变量

6. 掌握指针与变量、指针与数组、指针与字符串的关系

7. 了解和会用指针作为函数参数的方法。

实验内容:

1. 数组定义,初始化和数组元素的访问

2. 二维数组的使用和在字符串处理中应用

3. 使用字符串处理函数

4. 指针的概念,了解内存空间的概念

5. 指针变量和指针所指向的变量

6. 函数参数传递的两种方式:按值传递和按地址传递

实验题目:

1. Enter 10numbers from the keyboard, write a program to find the maximal number and its subscript, and then arrange them from the biggest to the smallest, put the result in the array.

2. Write a pointer version of the function strcat that we showed in Chapter 2: strcat(s, t) copies the string t to the end of s.

3. Write a pointer version of the function,which can find the max number’s id of row and line number. In addition, the numbers are in a two-dimension array.

3、写一个指针版本的函数,它可以在此找到最大数量的id的排和线号码。此外,这些数字都是在一个二维数组。

实验三 Structures

实验要求:必做

1. 掌握结构体类型变量的定义和使用

2. 掌握结构体类型数组的概念和使用

3. 学会使用结构体指针变量

4. 了解链表的概念和链表操作

实验内容:

1. 结构体变量的定义和使用

2. 结构体指针

3. 链表的创建和输出

实验题目:

1. There are five students’ records each record includes id, name and the scores of three courses. Please write a program to enter the five students’ information, and then order them by the total score.

2. Put the information mentioned above in a link list, write functions to create and output the list.

实验四Input and Output

实验要求:必做

1. 复习基本的输入输出printf和scanf函数

2. 掌握文件和文件指针的概念和文件的方法

3. 学会使用文件的打开、关闭、读和写操作

4. 了解行输入和行输出

实验内容:

1. 文件的基本操作

2. 文件的行输入和输出

实验题目:

1. Please write the students’ information to a stud.txt file, and order the records by the student ID. Then write the result to same file.

2. Write a program to compare two files, printing the first line where they differ.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值