【C语言】14.动态内存分配

动态内存分配

1. 为什么存在动态内存分配

1.1 内存图

在这里插入图片描述

内存开辟方式有:
	int val = 20;//在栈空间上开辟四个字节
	char arr[10] = {0};//在栈空间上开辟10个字节的连续空间	

特点

开辟空间的方式有两个特点:

  1. 空间开辟大小是固定的。
  2. 数组在申明的时候,必须指定数组的长度,它所需要的内存在编译时分配。

问题

问题:对于空间的需求,不仅仅是上述的情况。有时候我们需要的空间大小在程序运行的时候才能知道,那数组的编译时开辟空间的方式就不能满足了。 这时候就只能试试动态内存开辟了。

//动态内存分配

//问题:设好大小为50个元素的数组,
//		若传入的数据是30个元素就很浪费,传入的数据是60个元素就不够

#include <stdio.h>

struct S
{
	char name[20];
	int age;
};

int main()
{
	//struct S arr[50];
	//若传入的数据是30个元素就很浪费,传入的数据是60个元素就不够

	//方法:设置一个自定义的数,自定义数组的大小 - 错误
	int n = 0;
	scanf("%d", &n);

	//struct S arr[n];	//err 错误
	//表达式必须含有常量值
	//应输入常量表达式
	//不能分配常量大小为 0 的数组
	//“arr” : 未知的大小

	return 0;
}

动态内存分配

动态内存函数:malloc、free、calloc、realloc

在这里插入图片描述

1.2 malloc和free

malloc和free都声明在 stdlib.h 头文件中

malloc

//C语言提供了一个动态内存开辟的函数:
void* malloc (size_t size);

**这个函数向内存申请一块连续可用的空间,并返回指向这块空间的指针。 **

  • 如果开辟成功,则返回一个指向开辟好空间的指针。
  • 如果开辟失败,则返回一个NULL指针,因此malloc的返回值一定要做检查。
  • 返回值的类型是 void* ,所以malloc函数并不知道开辟空间的类型,具体在使用的时候使用者自己来决定。
  • 如果参数 size 为0,malloc的行为是标准是未定义的,取决于编译器。
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>

int main()
{
	//向内存申请10个整型的空间
	//int* p = malloc(10 * sizeof(int));//应该会有警告:初始化”: “ int *”与“int”的间接级别不同
	//但是编译器没有报错
	int* p = (int*)malloc(10 * sizeof(int));


	//int* p = (int*)malloc(INT_MAX);
	// 	让程序开辟错误 - 输入INT_MAX
	//	erro : Not enough space

	if (p == NULL)
	{
		//打印错误原因的一个方式
		printf("%s\n", strerror(errno));
	}
	else
	{
		//正常使用空间
		int i = 0;
		for ( i = 0; i < 10; i++)
		{
			*(p + i) = i;
		}
		for ( i = 0; i < 10; i++)
		{
			printf("%d ", *(p + i));
		}
	}

	return 0;
}

在这里插入图片描述

free

//C语言提供了另外一个函数free,专门是用来做动态内存的释放和回收的,函数原型如下:
void free (void* ptr);

free函数用来释放动态开辟的内存

  • 如果参数 ptr 指向的空间不是动态开辟的,那free函数的行为是未定义的。
  • 如果参数 ptr 是NULL指针,则函数什么事都不做。
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>

int main()
{
	//向内存申请10个整型的空间
	//int* p = malloc(10 * sizeof(int));//应该会有警告:初始化”: “ int *”与“int”的间接级别不同
	//但是编译器没有报错
	int* p = (int*)malloc(10 * sizeof(int));


	//int* p = (int*)malloc(INT_MAX);
	// 	让程序开辟错误 - 输入INT_MAX
	//	erro : Not enough space

	//申请失败,返回的指针为NULL,
	//所以每次执行申请动态内存后判别返回地指针是否为NULL就相当重要了
	if (p == NULL)
	{
		//打印错误原因的一个方式
		printf("%s\n", strerror(errno));
	}
	else
	{
		//正常使用空间
		int i = 0;
		for (i = 0; i < 10; i++)
		{
			*(p + i) = i;
		}
		for (i = 0; i < 10; i++)
		{
			printf("%d ", *(p + i));
		}
	}
	//当动态申请的空间不再使用的时候
	//就应该还给操作系统
	free(p);//释放 p 所指向的动态内存

	p = NULL;//是否有必要?- 有
	//因为释放后的 p 还是存在的,可以通过某种方式找到 p 的内容

	return 0;
}

1.3 calloc

malloc创建动态内存空间没有初始化

在这里插入图片描述

calloc创建时就开始初始化

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

int main()
{
	//malloc(10 * sizeof(int))
	int* p = (int*)calloc(10, sizeof(int));//calloc创建时就开始初始化

	if (p ==NULL)
	{
		printf("%s\n", strerror(errno));
	}
	else
	{
		int i = 0;
		for ( i = 0; i < 10; i++)
		{
			printf("%d ", *(p + i));
		}
	}
	//释放空间
	//free函数是用来释放动态开辟的空间的
	free(p);
	p = NULL;

	return 0;
}

在这里插入图片描述

calloc() 与 malloc() 的一个重要区别是:calloc() 在动态分配完内存后,自动初始化该内存空间为零,而 malloc() 不初始化,里边数据是未知的垃圾数据

1.4 realloc

  • realloc函数的出现让动态内存管理更加灵活。

  • 有时会我们发现过去申请的空间太小了,有时候又会觉得申请的空间过大了,那为了合理的时候内存, 一定会对内存的大小做灵活的调整。那 realloc 函数就可以做到对动态开辟内存大小的调整。

//函数原型 如下:
    void* realloc (void* ptr, size_t size);
  • ptr 是要调整的内存地址
  • size 调整之后新大小 返回值为调整之后的内存起始位置。
  • 这个函数调整原内存空间大小的基础上,还会将原来内存中的数据移动到 新 的空间。

简单使用realloc

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

int main()
{
	int* p = (int*)malloc(20);
	if (p == NULL)
	{
		printf("%s\n", strerror(errno));
	}
	else
	{
		int i = 0;
		for ( i = 0; i < 5; i++)
		{
			*(p + i) = i;
		}
	}

	//就是在使用malloc开辟的20个字节空间
	//假设这里,20个自字节不能满足我们的使用了
	//希望我们能够有40个字节的空间
	//这里就可以使用realloc来调整动态开辟的内存
	int* p2 = realloc(p, 40);
	int i = 0;
	for ( i = 0; i < 10; i++)
	{
		printf("%d ", *(p2 + i));
	}
	free(p2);
	p2 = NULL;

	return 0;
}

在这里插入图片描述

在这里插入图片描述

使用realloc的注意事项

realloc在调整内存空间的是存在两种情况:

  • 情况1:原有空间之后有足够大的空间
  • 情况2:原有空间之后没有足够大的空间
错误情况
//动态内存分配

//realloc的注意事项
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>

int main()
{
	int* p = (int*)malloc(20);
	if (p == NULL)
	{
		printf("%s\n", strerror(errno));
	}
	else
	{
		int i = 0;
		for (i = 0; i < 5; i++)
		{
			*(p + i) = i;
		}
	}

	//realloc使用的注意事项:
	//1.如果p指向的空间之后有足够的内存空间可以追加,则直接追加,后返回p
	//2.如果p指向的空间之后没有足够的内存空间可以追加,则realloc函数会重新找一个新的内存区域,
	//		开辟一块满足需求的空间,并且把原来内存中的数据拷贝回来,释放旧的内存空间
	//		最后返回新开辟的内存空间地址
	//3. 得用一个新的变量来接受realloc函数的返回值

	//错误情况
	//p = realloc(p, 4000);
	//int i = 0;
	//for (i = 0; i < 10; i++)
	//{
	//	printf("%d ", *(p + i));
	//}

	int* ptr = realloc(p, INT_MAX);//用一个新的变量来接受realloc函数的返回值

	if (ptr != NULL)//新的变量没有为空指针
	{
		p = ptr;//再将 ptr指针 赋值给 p指针
		
		//再进行其他操作
		int i = 0;
		for (i = 0; i < 10; i++)
		{
			printf("%d ", *(p + i));
		}
	}

	//释放内存
	free(p);
	p = NULL;

	return 0;
}

在这里插入图片描述

查看监视 p 的内存变化

在这里插入图片描述

2. 常见的动态内存错误

2.1 对NULL指针的解引用操作

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

错误情况
//int main()
//{
//	//1.对NULL进行解引用操作
//	int* p = (int*)malloc(40);
//	//万一 malloc 失败了,p就被赋值为NULL
//	*p = 0;//erro
//	
//	int i = 0;
//	for ( i = 0; i < 10; i++)
//	{
//		*(p + i) = i;//err
//	}
//	free(p);
//
//	return 0;
//}


int main()
{
	//1.对NULL进行解引用操作
	int* p = (int*)malloc(40);
	//万一 malloc 失败了,p就被赋值为NULL
	if (p == NULL)
	{
		printf("%s\n", strerror(errno));
	}
	else//不为空指针进行以下操作
	{
		int i = 0;
		for (i = 0; i < 10; i++)
		{
			*(p + i) = i;//err
		}
	}
	
	free(p);

	return 0;
}

2.2 对动态开辟空间的越界访问

 
#include <stdio.h>
#include <stdlib.h>

int main()
{
	int* p = (int*)malloc(10 * sizeof(int));

	if (NULL == p)
	{
		return 0;
	}
	else
	{
		int i = 0;
		for (i = 0; i <= 10; i++)
		{
			*(p + i) = i;//当i是10的时候越界访问 - 程序会崩掉
		}
	}
	free(p);
}

2.3 使用free释放一块动态开辟内存的一部分

#include <stdio.h>
#include <stdlib.h>

int main()
{
	int a = 10;
	int* p = &a;
	*p = 20;

	free(p);
	p = NULL;

	return 0;
}
/*
	- 程序奔溃
	错误原因:a其实是在栈区的,而动态内存函数是在堆区,强行free会程序错误

*/

2.3 使用free释放一块动态开辟内存的一部分

#include <stdio.h>
#include <stdlib.h>

int main()
{
	int* p = (int*)malloc(40);
	if (p == NULL)
	{
		return 0;
	}
	int i = 0;
	for ( i = 0; i < 10; i++)
	{
		*p++ = i;//因为后置++,先使用后++,使用p,跳到下一个地址,然后解引用
	}
	//回收空间
	//使用free释放动态开辟内存的一部分
	free(p);
	p = NULL;

	return 0;
}
/*
	程序奔溃
	因为后面 free函数的 p 的地址已经不是要释放的内存
	只是 p 开辟空间的其中一部分
*/

2.4 对同一块动态内存多次释放

#include <stdio.h>
#include <stdlib.h>

int main()
{
	int* p = (int*)malloc(40);
	if (p == NULL)
	{
		return 0;
	}

	//使用
	//释放
	free(p);
	//...
	free(p);// 对同一块动态内存多次释放 - 错误

	return 0;
}

修改代码

//修改
#include <stdio.h>
#include <stdlib.h>

int main()
{
	int* p = (int*)malloc(40);
	if (p == NULL)
	{
		return 0;
	}

	//使用
	//释放
	free(p);
	p = NULL;//修改处:将p指针设置为空指针
	//...
	free(p);

	return 0;
}

2.5 动态开辟内存忘记释放(内存泄漏)

#include <stdio.h>
#include <stdlib.h>

int main()
{
	while (1)
	{
		malloc(1);// 动态开辟内存忘记释放(内存泄漏)
		//循环一直进行没有free掉内存,不断占用内存,
		//直到内存耗尽
		//忘记释放不再使用的动态开辟的空间会造成内存泄漏。 
		//切记: 动态开辟的空间一定要释放,并且正确释
	}

	return 0;
}

3. 面试题

1

#include <stdio.h>
#include <stdlib.h>

void GetMemory(char* p)//函数得到的是NULL,而不是str的地址
{
	p = (char*)malloc(100);//开辟空间后,函数结束丢弃 p
	//而且传入的 str 没有发生任何变化,仍然是NULL值
}

void Test(void)
{
	char* str = NULL;
	GetMemory(str);//传值操作,而不是传址操作,函数没有得到地址
	//函数没有改变str,仍然是NULL值
	strcpy(str, "hello world");//没有进行到这一步,程序崩溃
	printf(str);//没有进行到这一步,程序崩溃
	//没有free(str)释放内存
}

int main()
{
	Test();
	/*
		1.运行代码程序会出现崩溃的现象
		2.程序存在内存泄漏的问题
		str以值传递的形式给p
		p是GetMemory函数的形参,只能函数内部有效
		等GetMemory函数返回之后,动态开辟内存尚未释放
		并且无法找到,所以会造成内存泄漏

	*/

	return 0;
}

在这里插入图片描述

方式一

//方式一
#include <stdio.h>
#include <stdlib.h>

void GetMemory(char** p)//函数用二级指针接收str地址
{
	*p = (char*)malloc(100);//用str的地址创建100个字节动态内存空间
}

void Test(void)
{
	char* str = NULL;
	GetMemory(&str);//传入str的地址,创建动态内存空间
	strcpy(str, "hello world");
	printf(str);

	free(str);
	str = NULL;
}

int main()
{
	Test();

	return 0;
}

方式二

//方式二
#include <stdio.h>
#include <stdlib.h>

char* GetMemory(char* p)//函数用接收str地址,返回 char* 类型
{
	p = (char*)malloc(100);//用str的地址创建100个字节动态内存空间
	return p;
}

void Test(void)
{
	char* str = NULL;
	str = GetMemory(str);//传入str的地址,将返回的 p 地址 赋值给str
 	strcpy(str, "hello world");
	printf(str);

	free(str);
	str = NULL;
}

int main()
{
	Test();

	return 0;
}

2

#include <stdio.h>
#include <stdlib.h>

char* GetMemory(void)
{
	char p[] = "hello world";//创建动态内存空间
	return p;//返回动态内存空间的地址
}
void Test(void)
{
	char* str = NULL;
	str = GetMemory();//将GetMemory函数返回的地址赋值给 str 
	printf(str);
}
/*
* 非法访问地址的错误
	错误原因:	GetMemory函数创建数组后,只在内部使用,是局部变量的内容,放在栈区,返回地址,
				但是返回的地址赋值给str,此时GetMemory函数结束,对GetMemory函数的内容进行销毁
				所以只有 p 的地址,但此时原来的数组已经不存在
				再进行 printf(str); 操作,这个地址不知道被谁调用,会打印随机值

				这个问题:返回栈空间的地址的问题
*/

int main()
{
	Test();

	return 0;
}

相同的问题

静态区

//返回栈空间的地址的问题
#include <stdio.h>
#include <stdlib.h>

int* test()
{
	//static int a = 10;
	//修改点 - 用static修饰,将栈区的错误改成静态区,就不会结束函数就销毁数据
	int a = 10;//栈区
	return &a;
}

int main()
{
	int* p = test();
	*p = 20;
	return 0;
}

堆区

#include <stdio.h>
#include <stdlib.h>

int* test()
{
	int* ptr = malloc(100);//堆区
	return ptr;
}
/*
	代码没错误,因为malloc的动态内存空间是放在堆区,没有经过free是不会销毁
	虽然test函数结束后会将 ptr 进行销毁,但是已经将ptr的地址赋值给p,
	销毁了但是创建的动态内存空间还在,还是可以通过地址 p 去访问动态内存空间
	所以说代码没错误
*/

int main()
{
	int* p = test();

	return 0;
}

3

#include <stdio.h>
#include <stdlib.h>

void GetMemory(char** p, int num)
{
	*p = (char*)malloc(num);
}
void Test(void)
{
	char* str = NULL;
	GetMemory(&str, 100);
	strcpy(str, "hello");
	printf(str);
	//代码可以执行,但是忘记释放动态开辟的内存,导致内存泄漏了
	// 
	//改正点 - 释放空间
	free(str);
	str = NULL;
}

int main()
{
	Test();

	return 0;
}
/*
	(1)能够输出hello
	(2)内存泄漏
*/

4

#include <stdio.h>
#include <stdlib.h>

void Test(void)
{
	char* str = (char*)malloc(100);
	strcpy(str, "hello");
	free(str);//free释放str指向的空间后,并不会把str置为NULL
	str = NULL;//修改点
	//如果将free、str=NULL放在if语句后面,if语句没什么作用
	//真正考察的是 free 释放str指向的空间后,并不会把str置为NULL
	//free后并没有 str=NULL 的话,str被释放,但是没有置为NULL,str成为野指针
	//free后还是可以忽略条件继续执行if语句,代码就错误了
	if (str != NULL)
	{
		strcpy(str, "world");
		printf(str);
	}
}

int main()
{
	Test();

	return 0;
}
/*
	答:	篡改动态内存区的内容,后果难以预料,非常危险。
		因为free(str);之后,str成为野指针,if(str != NULL)语句不起作用。
*/

4. C/C++程序的内存开辟

#include <stdio.h>
#include <stdlib.h>

int globaVar = 1;
static int staticGlobalVar = 1;

void Test()
{
	static int staticVar = 1;
	int localVar	= 1;
	int num1[10]	= { 1,2,3,4 };

	char cahr2[]	= "abcd";
	char* pChar3	= "abcd";

	int* ptr1		= (int*)malloc(sizeof(int) * 4);
	int* ptr2		= (int*)calloc(4, sizeof(int));
	int* ptr3		= (int*)realloc(ptr2, sizeof(int) * 4);

	free(ptr1);
	free(ptr3);
}

在这里插入图片描述

**C/C++程序内存分配的几个区域: **

栈区(stack):

在执行函数时,函数内局部变量的存储单元都可以在栈上创建,函数执行结束时这些存储单元自动被释放。

栈内存分配运算内置于处理器的指令集中,效率很高,但是分配的内存容量有限。

栈区主要存放运行函数而分配的局部变量、函数参数、返回数据、返回地址等。

堆区(heap):

一般由程序员分配释放,若程序员不释放,程序结束时可能由OS回收。分配方式类似于链表。

数据段(静态区)(static):

存放全局变量、静态数据。程序结束后由系统释放。

代码段

存放函数体(类成员函数和全局函数)的二进制代码。

static 关键字修饰局部变量

实际上普通的局部变量是在栈区分配空间的,栈区的特点是在上面创建的变量出了作用域就销毁。

但是被static修饰的变量存放在数据段(静态区),数据段的特点是在上面创建的变量,

直到程序结束才销毁所以生命周期变长。

5. 柔性数组

C99 中,结构中的最 后一个元素允许是未知大小的数组,这就叫做 柔性数组 成员

#include <stdio.h>

//struct S
//{
//	int n;
//	int arr[10];//固定的数组
//};

struct S
{
	int n;
	int arr[];//未知大小 -未知大小的 - 柔性数组成员-数组的大小是可以调整的
};

//struct S
//{
//	int n;
//	//有些编译器会报错无法编译可以改成:
//	int arr[0];//未知大小	
//};

int main()
{
	struct S s;

	return 0;
}

5.1 柔性数组的特点:

  • 结构中的柔性数组成员前面必须至少一个其他成员。
  • sizeof 返回的这种结构大小不包括柔性数组的内存。
  • 包含柔性数组成员的结构用malloc()函数进行内存的动态分配,并且分配的内存应该大于结构的大小,以适应柔性数组的预期大小。

sizeof 返回的这种结构大小不包括柔性数组的内存。

//sizeof 返回的这种结构大小不包括柔性数组的内存
#include <stdio.h>

struct S
{
	int n;
	int arr[0];
};

int main()
{
	struct S s;
	printf("%d\n", sizeof(s));//4

	return 0;
}

包含柔性数组成员的结构用malloc()函数进行内存的动态分配,并且分配的内存应该大于结构的大小,以适应柔性数组的预期大小。

在这里插入图片描述

#include <stdio.h>
#include <stdlib.h>

struct S
{
	int n;
	int arr[];
};

int main()
{
	struct S* ps = (struct S*)malloc(sizeof(struct S) + 5 * sizeof(int));//开辟24个字节空间
	ps->n = 100;
	int i = 0;
	for ( i = 0; i < 5; i++)//赋值 0 1 2 3 4 给数组
	{
		ps->arr[i] = i;//0 1 2 3 4
	}

	struct S* ptr = realloc(ps, 44);//ps 重新开辟新的空间赋值给ptr
	if (ptr != NULL)
	{
		ps = ptr;
	}

	for ( i = 5; i < 5; i++)//添加新的数组元素
	{
		ps->arr[i] = i;
	}

	for ( i = 0; i < 10; i++)
	{
		printf("%d ", ps->arr[i]);//打印数组元素
	}

	//释放
	free(ps);
	ps = NULL;

	return 0;
}

5.2 区别

//第一种柔性数组开辟数组空间的用法
//直接结构体开辟整体空间,然后分配给其他结构体,剩下给数组,可以再开辟新空间给数组
#include <stdio.h>
#include <stdlib.h>

struct S
{
	int n;
	int arr[];
};

int main()
{
	struct S* ps = (struct S*)malloc(sizeof(struct S) + 5 * sizeof(int));//开辟24个字节空间
	ps->n = 100;
	int i = 0;
	for ( i = 0; i < 5; i++)//赋值 0 1 2 3 4 给数组
	{
		ps->arr[i] = i;//0 1 2 3 4
	}

	struct S* ptr = realloc(ps, 44);//ps 重新开辟新的空间赋值给ptr
	if (ptr != NULL)
	{
		ps = ptr;
	}

	for ( i = 5; i < 5; i++)//添加新的数组元素
	{
		ps->arr[i] = i;
	}

	for ( i = 0; i < 10; i++)
	{
		printf("%d ", ps->arr[i]);//打印数组元素
	}

	//释放
	free(ps);
	ps = NULL;

	return 0;
}
//第二种开辟数组空间用法
//用结构体定义一个数组指针,指向一个数组
//数组 malloc 开辟空间,ralloc 将数组调整大小,开辟更大的空间,方便放入更多数组
#include <stdio.h>
#include <stdlib.h>

struct S
{
	int n;
	int* arr;
};

int main()
{
	struct S* ps = (struct S*)malloc(sizeof(struct S));
	ps->arr = malloc(5 * sizeof(int));

	int i = 0;
	for ( i = 0; i < 5; i++)
	{
		ps->arr[i] = i;
	}
	for ( i = 0; i < 5; i++)
	{
		printf("%d ", ps->arr[i]);
	}
	//调整大小
	int* ptr = realloc(ps->arr, 10 * sizeof(int));
	if (ptr == NULL)
	{
		ps->arr = ptr;
	}
	for ( i = 5; i < 10; i++)
	{
		ps->arr[i] = i;
	}
	for ( i = 0; i < 10; i++)
	{
		printf("%d ", ps->arr[i]);
	}
	//释放内存 - free要注意顺序,在结构体里面的先释放,不然找不到了,有可能内存会泄漏
	free(ps->arr);
	ps->arr = NULL;
	free(ps);
	ps = NULL;

	return 0;
}

区别

第二种比第一种更容易出现错误,要free两个内存,而且要注意前后顺序。

第二种开辟用了两次malloc,空间开辟时会有一些空隙,被称为内存碎片,导致空间浪费,第一种空间利用率高。

第一种开辟的空间是连续的,内存访问率更高

上述 代码1 和 代码2 可以完成同样的功能,但是 方法1 的实现有两个好处:

第一个好处是:方便内存释放
如果代码是在一个给别人用的函数中,你在里面做了二次内存分配,并把整个结构体返回给用户。

用户调用free可以释放结构体,但是用户并不知道这个结构体内的成员也需要free,所以你不能指望用户来发现这个事。

所以,如果把结构体的内存以及其成员要的内存一次性分配好了,并返回给用户一个结构体指针,用户做一次free就可以把所有的内存也给释放掉。

第二个好处是:这样有利于访问速度

连续的内存有益于提高访问速度,也有益于减少内存碎片。

GitHub代码

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值