函数|函数递归|二分查找法// 学习笔记(一)

本文详细探讨了C语言中的函数递归原理,并通过实例讲解了如何运用递归实现二分查找算法。通过对递归的深入理解,帮助读者掌握这一重要的编程技巧。
摘要由CSDN通过智能技术生成
#define _CRT_SECURE_NO_WARNINGS
 什么是函数| 子程序
#include<stdio.h>

函数
int Add(int x, int y)
{
	int z = 0;
	z = x + y;
	return z;
}

int main()
{
	int a = 0;
	int b = 3;
	int sum = Add(a, b);
	printf("%d\n", sum);
	//strlen
	return 0;
}


int main()
{
	//strcpy - string copy 字符串拷贝
	//strlen - string lenth 字符串长度
	return 0;

}

#include <stdio.h>
#include <string.h>

int main()
{
	//char * strcpy ( char * destination, const char * source )
	//                 目的地            , 来源
	char str1[] = "Sample string";
	// \0的内容也同时拷贝进去
	char str2[40] = "##########";
	char str3[40];
	strcpy(str2, str1);
	// \0的内容也同时拷贝进去 | \0作为结束标志,所以剩余的###不会出现

	strcpy(str3, "copy successful");
	printf("str1: %s\nstr2: %s\nstr3: %s\n", str1, str2, str3);
	system("pause");
	return 0;
}

 memset
 memory set - 内存 设置

int main()
{
	char arr[] = "hello world";
	memset(arr
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值