strlen,_conntof,sizeof

#include "stdafx.h"
#include<iostream>
int _tmain(int argc, _TCHAR* argv[])
{
	char string_a[10] = "hello";
	char *string_p = "hello";
	int  a[10] = { 12, 12, 12, 12, 12 };
        int len=strlen(string_a);
	//strlen返回字符数组中实际的元素个数
	//strlen参数必须为字符数组名,其他类型不支持
	int size = sizeof(string_a);
	//sizeof,参数为各个不同类型,返回该类型占内存大小,单位为字节
	//sizeof,如果传入数组名,返回该数组总大小
	int number = _countof(string_a);
	//参数为数组名,返回改数组中元素个数
	//该元素个数为一开始分配的个数,即即使里边没有值,也算一个元素。
	return 0;
}
让数据变得更安全!
原文地址:https://www.cnblogs.com/Alyoyojie/p/5129201.html