码迷,mamicode.com
首页 >  
搜索关键字:char    ( 35907个结果
利用fgets,fputs的回显程序
#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++ String 转 char*
近期一直用惯了C#,陡然间改回C++都有些不习惯了!吐槽一下,C#太方便了!!!言归正传,C++里有些时候会用到String转char*这个功能,于是进来搜到了一些方法:假设你申请了这样一个字符串:string str = "This is a test!",那么:1、str.data()能够返回该...
分类:编程语言   时间:2014-06-25 23:58:23    阅读次数:354
oj2892(字典树)
一改时间以后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
无需考虑编码问题string转byte的方法
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
OpenCV —— 矩阵和图像操作
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
Lcd菜单处理编程
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
指针知识梳理5-字符串与指针,程序内存总结
一、文字常量区域 #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
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!