#include #define MAXLINE 20int main(void){char line[MAXLINE];while(fgets(line,MAXLINE,stdin) != NULL && line[0] != '\n') fputs(line, stdout);return 0;...
分类:
其他好文 时间:
2014-06-26 00:18:04
阅读次数:
256
近期一直用惯了C#,陡然间改回C++都有些不习惯了!吐槽一下,C#太方便了!!!言归正传,C++里有些时候会用到String转char*这个功能,于是进来搜到了一些方法:假设你申请了这样一个字符串:string str = "This is a test!",那么:1、str.data()能够返回该...
分类:
编程语言 时间:
2014-06-25 23:58:23
阅读次数:
354
一改时间以后WA了,我就知道这题是考字典树,可惜代码怎么也不会敲了,郁闷。#include #include #include typedef struct Node{ int flag;struct Node *next[26];}Node,*Tree;char a[200010][6];int ...
分类:
其他好文 时间:
2014-06-24 14:31:01
阅读次数:
161
static byte[] GetBytes(string str){ byte[] bytes = new byte[str.Length * sizeof(char)]; System.Buffer.BlockCopy(str.ToCharArray(), 0, bytes, 0, ...
分类:
其他好文 时间:
2014-06-24 14:15:24
阅读次数:
145
class DateConvert { private static DateConvert m_DateConvert = null; private static char[] strChinese = new char[] { '〇','一','二','三','四','五','...
分类:
其他好文 时间:
2014-06-24 13:56:41
阅读次数:
191
cvAbs , cvAbsDiff , cvAbsDiffS cvAdd , cvAddS , cvAddWeighted(可添加权重) #include #include int main(int argc,char** argv){ IplImage *s1,*s2; s1=cvLoadImag...
分类:
其他好文 时间:
2014-06-24 13:56:00
阅读次数:
238
生产者#include#include#includeusing namespace std; int main(void) { ofstream out; const char ch = '*'; long long k = 0; DWORD64 time = GetTickCount64(); ...
分类:
其他好文 时间:
2014-06-24 11:29:19
阅读次数:
354
#include const char* first = "";//需要验证的字符std::regex rx("^[1-9]\\d{5}[1-9]\\d{3}((0\\d)|(1[0-2]))(([0|1|2]\\d)|3[0-1])\\d{3}([0-9]|X|x)$");//验证的表达式,这个是...
分类:
其他好文 时间:
2014-06-24 11:13:54
阅读次数:
164
Menu.h#ifndef__MENU_h__#define__MENU_h__#include"Functions.h"/*目录结构体定义* /structMenuItem{shortMenuCount;char*DisplayString;void(*Subs)();structMenuItem...
分类:
其他好文 时间:
2014-06-22 12:08:36
阅读次数:
282
一、文字常量区域
#include
int main()
{
char *p = "hello";
int i = 0;
for(i = 0;i<6;i++)
{
printf("%c",*(p+i));
}
*p = '1';
}
大家分析验证以上代码,p 是一个指针变量,存储地址,“hello”是一个字符串占6个字节,当我们用printf的时候能够输出"hello...
分类:
其他好文 时间:
2014-06-22 09:32:20
阅读次数:
200