Reference: http://saiyaren.iteye.com/blog/1943207 1. Shell 读取文件和写文件 for line in $(<top30000.url.utf-8.http_server_front_hphp.txt); do tmp_port=8080; for((i=0;i<=7;i++));do echo ${line/192\.168\.12\.63/192\.168\.12\.63:$tmp_port} >>top3000
<转自百度知道> 1.c语言中,定义数组后可以用sizeof命令获得数组的长度(可容纳元素个数). 例如: int data[4]; int length; length=sizeof(data)/sizeof(data[0]); //数组占内存总空间,除以单个元素占内存空间大小 printf("length of data[4]=%d", length ); //输出length of data[4]=4 2.但是,通过传递数组名参数到子函数中,以获得数组长度是不可行的
java中没有关于修改数组长度的api,在此本人提供了修改数组长度的两个函数:arrayAddLength()和arrayReduceLength().详细见代码. [java] view plaincopyprint? import java.lang.reflect.Array; /** * Description: This class is used to adjust array length. * @author e421083458 * */ public