2015.3.2//数组//NSArray(不可变数组)//数组:对象地址的有序集合//int main(int argc, const char * argv[]) { @autoreleasepool { NSNumber *num1 = [NSNumber numberWithInt:...
分类:
编程语言 时间:
2015-03-02 22:14:36
阅读次数:
212
调试Perl程序时,使用Smart::Comment模块,追踪代码的变量值,非常方便有效。代码示例:1 #!/usr/bin/perl2 3 use Smart::Comments;4 # no Smart::Comments;5 my $var=@ARGV[0];6 7 ### $var;执行代码...
分类:
其他好文 时间:
2015-03-02 18:16:38
阅读次数:
125
当perl程序需要处理用户输入的参数时,有两种方式:第一种方法是:使用@ARGV数组第二种方法是:调用Getopt::Long模块,该方法方便而强大。本文主要介绍该方法。Getopt::Long 在Perl中的调用实例:#!/usr/bin/perluse Getopt::Long;my ($ver...
分类:
其他好文 时间:
2015-03-02 16:20:19
阅读次数:
172
首先先解释一下
int main(int argc,char* argv[])的含义
argc是命令行总的参数个数
argv[]是argc个参数,其中第0个参数是程序的全名,以后的参数命令行后面跟的用户输入的参数
比如:
int main(int argc, char* argv[])
{
int i;
for...
分类:
其他好文 时间:
2015-03-02 11:14:25
阅读次数:
130
当学会了python的解释器之后,那么脚本名称其后(thereafter)附加的参数信息则会转变(turn into)成为一个字符串列表,然后传递给python中的 sys 模块里的 argv 变量。你可以访问这个参数列表,通过执行下面的代...
分类:
其他好文 时间:
2015-03-01 23:55:26
阅读次数:
474
1 #include 2 #include 3 4 int main(int argc, char *argv[]) 5 { 6 if(argc == 2)//将文件中的打印到标准输出 7 { 8 FILE *fp; 9 if( !(fp = ...
分类:
编程语言 时间:
2015-02-28 20:09:41
阅读次数:
441
#include #include #include int main(int argc, char *argv[]){ QCoreApplication a(argc, argv); QString servername="THINKPAD-PC"; //LOCALHOST QS...
分类:
数据库 时间:
2015-02-28 18:36:02
阅读次数:
146
#include #include #include int main(int argc, char *argv[]){ QCoreApplication a(argc, argv); QSqlDatabase db=QSqlDatabase::addDatabase("QODBC");...
分类:
数据库 时间:
2015-02-28 18:34:44
阅读次数:
170
#import int a[101],n;void quickSort(int left,int right);int main(int argc, const char * argv[]) { @autoreleasepool { // insert code here... ...
分类:
编程语言 时间:
2015-02-28 18:31:15
阅读次数:
179
2015.2.27星期五,小雨标准IO实现的复制功能:#include #include #define N 64int main(int argc, char *argv[]){ int n; char buf[N]; FILE *fps, *fpd; if(argc \n",argv[0]); ...
分类:
其他好文 时间:
2015-02-27 22:48:32
阅读次数:
210