sscanf && ssprintf && 数组传参 && 结构体初始化 && 区分引用和指针

sscanf(str, “%d”, &n); //str->int 类似cin从左到右
sprintf(str, “%d”, n); //str <- int 类似cout从右向左
str只能为字符串数组*********************
数组作为函数传参, 不需要数组长度,且函数内修改是直接对原始值进行修改。
void chang(int a[], int b[][6])
{
pass;
}

区分引用(c++)和指针(c)

结构体初始化

struct A 
{
	int b;
	int c;
	A(int _a,int _b)
	{
		b=_a;
		c=_b;
	};
};

猜你喜欢

转载自blog.csdn.net/weixin_39742952/article/details/87924217