1 #include 2 #include 3 using namespace std; 4 int main(){ 5 string s; 6 char tmp; 7 getline(cin,s); 8 for(int i=0;i<s.length()/2;i++...
分类:
其他好文 时间:
2014-07-07 12:51:30
阅读次数:
199
1、使用FileStream读写文件 文件头: using System;using System.Collections.Generic;using System.Text;using System.IO; 读文件核心代码: byte[] byData = new byte[100];char[]...
分类:
其他好文 时间:
2014-07-07 11:52:47
阅读次数:
151
getopt被用来解析命令行选项参数。#include extern char *optarg; //选项的参数指针extern int optind, //下一次调用getopt的时,从optind存储的位置处重新开始检查选项。 extern int opterr, //当opterr=0...
分类:
其他好文 时间:
2014-07-07 11:11:37
阅读次数:
246
#if defined(__CHAR_UNSIGNED__) || defined(__sgi) #define INT1 signed char /* integer, signed 1 Byte */#define INT1_MIN SCHAR_MIN...
分类:
其他好文 时间:
2014-07-02 19:19:04
阅读次数:
346
使用编译器vs2008。第一、第二个參数的使用方法:样例:使用ie打开指定的网页。注意第二个參数是 可运行文件+命令行參数#include "stdafx.h"#include #include int main(int argc, char* argv[]) { STARTUPINFO si...
分类:
其他好文 时间:
2014-07-02 18:13:44
阅读次数:
173
1 #include 2 using namespace std; 3 int main(){ 4 int a,b; 5 char s; 6 while(cin>>a){ 7 cin>>s>>b; 8 if(s=='+') 9 ...
分类:
其他好文 时间:
2014-07-02 17:36:14
阅读次数:
149
最近在研究单片机C51对汇编的接口问题。char和int等都比较简单,使用寄存器或固定地地址传值都是可以的,具体可以参考keil的C51 user‘s guide。本篇短文主要重点讨论一下A51下如何遵循C51的接口标准来实现C51的指针。...
分类:
其他好文 时间:
2014-07-02 17:00:10
阅读次数:
194
1 #include 2 #include 3 using namespace std; 4 int main(){ 5 string s; 6 char c; 7 getline(cin,s); 8 cin>>c; 9 if(s.find(c)!=stri...
分类:
其他好文 时间:
2014-07-02 15:02:48
阅读次数:
257
今天在看别人的CAN总线程序的时候,突然发现了这么一句宏定义:#define XBYTE ((unsigned char volatile xdata *) 0),以前都没注意到过。后来查了一下,发现是在ABSACC.h这个头文件中的。这是C51中专有的东西,在C51编程中只要有外部扩展RAM,就....
分类:
其他好文 时间:
2014-07-02 14:58:41
阅读次数:
358
sprintf函数太大,在STM8上面根本不敢用,动不动就.text overflow。为了将采集的数值通过串口上传到计算机,只能自己写了一个浮点数转换成字符串的函数: #include #include static char table[]={'0', '1', '2', '3', '4', '...
分类:
其他好文 时间:
2014-07-02 14:54:49
阅读次数:
206