Location:
Search - strcmp
Search list
Description: 函数int exit(int)的定义
函数int strcmp(char*,char*)的定义-function int exit (int) of the definition of function int strcmp (char *, char *), the definition
Platform: |
Size: 1504 |
Author: 黎笑涛 |
Hits:
Description: 常用算法 自定义strcmp 比较两个字符串是否匹配(本人第一个算法)-commonly used algorithm defined strcmp compare whether two strings match (I first algorithm) hee h
Platform: |
Size: 1081 |
Author: mystory |
Hits:
Description: FMC实现密码探测器功能FILE *input,*output
char temp
if(strcmp(infile,outfile)!=0 && ((input=fopen(infile,\"rb\"))!=NULL) && ((output=fopen
Platform: |
Size: 3669 |
Author: 王国栋 |
Hits:
Description: 通配符字符串比较函数,c++编写,速度自认为还可以,bug不知,如那位大侠发现bug或有更好的算法还请告知.(gmajvfhp@163.com)
Platform: |
Size: 994 |
Author: gmaj |
Hits:
Description: strchr strcmp strcat 源码
Platform: |
Size: 1433 |
Author: tianya |
Hits:
Description: 该组件可用编写字符串和数字运算处理脚本,供运行时调用获取执行结果
1、组件调用的方式可以参考 main.cpp
2、脚本的编写可以参考 debug/my.cfg
3、可调用系统函数有
atof: 将字符串转换为浮点数
ceil:
floor:
abs:
index:
strcmp:
substr:
strlen:
trim:
strstr:
split:
replace:字符串替换函数
printf:
这些函数基本与同名c函数相同
4、可预先编写一组脚本文件,编译时为每个文件指定ID,供调用时选择
Platform: |
Size: 434708 |
Author: 范哲伟 |
Hits:
Description: 字符串比较函数,支持“*”串通配和“?”字通配符,用 C语言编写,速度比较快.
Platform: |
Size: 996 |
Author: gmaj |
Hits:
Description: 这是我制的,调试过,小意思别见笑可以将输入的两字符串进行比较相等返回0,不等时返回两字符串的差值-This is my system, and the debugging that other small token of kindly feelings can be a laughing stock of the two input strings equal to 0 comparison, the returns ranging from two strings of the margin
Platform: |
Size: 1936 |
Author: 张元佑 |
Hits:
Description: 一个判断远程主机存活程序代码(ping)
#include
#include
#include
#include
#include "winsock.h"
#pragma comment(lib,"Ws2_32");
#define SEND_SIZE 32
#define PACKET_SIZE 4096
#define ICMP_ECHO 8
#define ICMP_ECHOREPLY 0
struct icmp
{
unsigned char icmp_type;
unsigned char icmp_code;
unsigned short icmp_cksum;
unsigned short icmp_id;
unsigned short icmp_seq;
unsigned long icmp_data;
};
struct ip
{
unsigned char ip_hl:4;
unsigned char ip_v:4;
unsigned char ip_tos;
unsigned short ip_len;
unsigned short ip_id;
unsigned short ip_off;
unsigned char ip_ttl;
unsigned char ip_p;
unsigned short ip_sum;
unsigned long ip_src;
unsigned long ip_dst;
};
unsigned char sendpacket[PACKET_SIZE];
unsigned char recvpacket[PACKET_SIZE];
struct sockaddr_in dest_addr;
struct sockaddr_in from_addr;
int sockfd;
int pid;
unsigned short cal_chksum(unsigned short *addr,int len);
int pack(int pack_no);
int unpack(unsigned char *buf,int len);
void send_packet(void);
void recv_packet(void);
void main(int argc,char *argv[])
{
struct hostent *host;
struct protoent *protocol;
WSADATA wsaData;
int timeout=1000;
int SEND_COUNT=4;
int i;
char *par_host;
par_host=argv[argc-1]; //IP赋值
switch(argc)
{
case 2: break;
case 3: if(strcmp(argv[1],"-t")==0)
{
SEND_COUNT=10000;
break;
}
//fall through
default:
printf("usage: %s [-t] Host name or IP address\n",argv[0]);
exit(1);
}
if(WSAStartup(0x1010,&wsaData)!=0)
{
printf("wsastartup error\n");
exit(1);
}
if( (protocol=getprotobyname("icmp") )==NULL)
{
printf("getprotobyname error\n");
exit(1);
}
/*
printf("%s\n",protocol->p_name);
printf("%s\n",protocol->p_aliases);
printf("%d\n",protocol->p_proto);
system("pause");
*/
if( (sockfd=socket(AF_INET,SOCK_RAW,protocol->p_proto) )<0)
{
printf("socket error\n");
exit(1);
}
if(setsockopt(sockfd,SOL_SOCKET,SO_RCVTIMEO,(char*)&timeout,sizeof(timeout))h_length);
//resolve address to hostname
if(host=gethostbyaddr(host->h_addr,4,PF_INET))
par_host=host->h_name;
//
//printf("%s\n",par_host);
//
}
else if( dest_addr.sin_addr.s_addr=inet_addr(par_host)==INADDR_NONE)
{
printf("Unkown host %s\n",par_host);
exit(1);
}
pid=getpid();
/*
printf("%d\n",pid);
system("pause");
*/
printf("Pinging %s [%s]: with %d bytes of data:\n\n",par_host,inet_ntoa(dest_addr.sin_addr),SEND_SIZE);
for(i=0;i1)
{ sum+=*w++;
nleft-=2;
}
if( nleft==1)
{ *(unsigned char *)(&answer)=*(unsigned char *)w;
sum+=answer;
}
sum=(sum>>16)+(sum&0xffff);
sum+=(sum>>16);
answer=~sum;
return answer;
}
//打包
int pack(int pack_no)
{
int packsize;
struct icmp *icmp;
packsize=8+SEND_SIZE;
icmp=(struct icmp*)sendpacket;
icmp->icmp_type=ICMP_ECHO;
icmp->icmp_code=0;
icmp->icmp_cksum=0;
icmp->icmp_seq=pack_no;
icmp->icmp_id=pid;
icmp->icmp_data=GetTickCount();
icmp->icmp_cksum=cal_chksum( (unsigned short *)icmp,packsize); /*校验算法*/
return packsize;
}
//解包
int unpack(unsigned char *buf,int len)
{
struct ip *ip;
struct icmp *icmp;
double rtt;
int iphdrlen;
ip=(struct ip *)buf;
iphdrlen=ip->ip_hl*4;
icmp=(struct icmp *)(buf+iphdrlen);
if( (icmp->icmp_type==ICMP_ECHOREPLY) && (icmp->icmp_id==pid) )
{
len=len-iphdrlen-8;
rtt=GetTickCount()-icmp->icmp_data;
printf("Reply from %s: bytes=%d time=%.0fms TTL=%d icmp_seq=%u\n",
inet_ntoa(from_addr.sin_addr),
len,
rtt,
ip->ip_ttl,
icmp->icmp_seq);
return 1;
}
return 0;
}
//发送
void send_packet()
{
int packetsize;
static int pack_no=0;
packetsize=pack(pack_no++);
if( sendto(sockfd,(char *)sendpacket,packetsize,0,(struct sockaddr *)&dest_addr,sizeof(dest_addr) )=0)
success=unpack(recvpacket,n);
else if (WSAGetLastError() == WSAETIMEDOUT)
{
printf("Request timed out.\n");
return;
}
}while(!success);
}
UID5380 帖子239 精华0 积分1289 阅读权限40 来自软件学院 在线时间81 小时 注册时间2006-5-22 最后登录2007-2-24 查看详细资料
TOP
Platform: |
Size: 5881 |
Author: shuiyuan313 |
Hits:
Description: 这是我制的,调试过,小意思别见笑可以将输入的两字符串进行比较相等返回0,不等时返回两字符串的差值-This is my system, and the debugging that other small token of kindly feelings can be a laughing stock of the two input strings equal to 0 comparison, the returns ranging from two strings of the margin
Platform: |
Size: 2048 |
Author: 张元佑 |
Hits:
Description: 函数int exit(int)的定义
函数int strcmp(char*,char*)的定义-function int exit (int) of the definition of function int strcmp (char*, char*), the definition
Platform: |
Size: 1024 |
Author: 黎笑涛 |
Hits:
Description: 常用算法 自定义strcmp 比较两个字符串是否匹配(本人第一个算法)-commonly used algorithm defined strcmp compare whether two strings match (I first algorithm) hee h
Platform: |
Size: 1024 |
Author: |
Hits:
Description: FMC实现密码探测器功能FILE *input,*output
char temp
if(strcmp(infile,outfile)!=0 && ((input=fopen(infile,"rb"))!=NULL) && ((output=fopen
-Password realize FMC detector functions FILE* input,* output char temp if (strcmp (infile, outfile)! = 0
Platform: |
Size: 3072 |
Author: 王国栋 |
Hits:
Description: 通配符字符串比较函数,c++编写,速度自认为还可以,bug不知,如那位大侠发现bug或有更好的算法还请告知.(gmajvfhp@163.com)-Wildcard string compare function, c++ Prepared, since the speed can also think, bug I do not know, such as the heroes who found bug or have a better algorithm also requested to inform. (Gmajvfhp@163.com)
Platform: |
Size: 1024 |
Author: gmaj |
Hits:
Description: 该组件可用编写字符串和数字运算处理脚本,供运行时调用获取执行结果
1、组件调用的方式可以参考 main.cpp
2、脚本的编写可以参考 debug/my.cfg
3、可调用系统函数有
atof: 将字符串转换为浮点数
ceil:
floor:
abs:
index:
strcmp:
substr:
strlen:
trim:
strstr:
split:
replace:字符串替换函数
printf:
这些函数基本与同名c函数相同
4、可预先编写一组脚本文件,编译时为每个文件指定ID,供调用时选择-The component can be used to prepare the string and digital processing script for run-time access to results of the implementation of one call, components can call the reference main.cpp2, the preparation of the script can refer to debug/my.cfg3, may call the system function has atof : convert a string to float ceil: floor: abs: index: strcmp: substr: strlen: trim: strstr: split: replace: string replace function printf: These functions are basically the same with the same name c function 4, can be prepared in advance by one Group script file, compile-time specified for each document ID, call for selection
Platform: |
Size: 435200 |
Author: 范哲伟 |
Hits:
Description: strcat,strcpy,strcmp,strlen函数原型,本人在VC6.0下调试通过的例子。-strcat, strcpy, strcmp, strlen function prototype, I have to debug through the VC6.0 example.
Platform: |
Size: 36864 |
Author: 刘飞飞 |
Hits:
Description: 该文件有strlen,strcpy,strcmp,strcat函数,代码风格规范,非常有利于初学者。-The document has strlen, strcpy, strcmp, strcat function, code style standards is very conducive to beginners.
Platform: |
Size: 8192 |
Author: 李晨旭 |
Hits:
Description: 设计一个strcmp算法,实现两个字符串s和t的比较-To design a strcmp algorithm comparison of two strings s and t
Platform: |
Size: 1024 |
Author: 石亚宁 |
Hits:
Description: compare two strings without using strcmp() function
Platform: |
Size: 1024 |
Author: Pralay Saha |
Hits:
Description: 汇编语言实现字符串比较,strcmp的功能-Assembly language to achieve the string comparison, strcmp function
Platform: |
Size: 1024 |
Author: 林知薇 |
Hits: