自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(35)
  • 资源 (5)
  • 收藏
  • 关注

转载 typedef 函数指针

#include <stdio.h>typedef char (*PTRFUN)(int); //typedef 定义一个新类型 类型为指针 //该指针指向一个函数 该函数一个int参数 返回值未charPTRFUN pFun; //新类型PTRFUN 该类型声明了一个pFun变量 char glFun(int a){ printf("%d\n",a);}int main(){...

2022-03-10 09:38:32 101

转载 获得文件状态信息

#include//C++ 获得文件状态信息源码,C++ 获得文件所在磁盘盘符源码,C++ 文件创建时间源码,C++ 访问时间源码,C++ 最后修改日期源码,No such file or directory(无此文件或索引)#include #include #include #include using namespace std;void main( void

2015-10-16 15:24:29 421

转载 数组,指针sizeof

#includeusing namespace std;void main(){ char A[4]; char *B="abcdefg"; void *c; c=new char[100]; cout cout cout cout cout //cout}

2015-10-15 16:16:03 288

转载 用指针的方法交换变量

#includeusing namespace std;void swap(int *p1,int *p2){ int temp; temp=*p1; *p1=*p2; *p2=temp; cout}int main(){  int i=3,j=5;  swap(&i,&j);  cout  return 0;

2015-10-15 16:08:02 381

转载 指针应用

#includeusing namespace std;void main(){  int *p;  int begin,end;  begin = 10;  p=&begin;  end=*p;  cout  cout  cout  cout}

2015-10-15 16:02:32 204

转载 参数为函数指针

#includeusing namespace std;int get_v(int a, int b, int(*sub)(int,int)){  return sub(a,b);}int max(int a,int b){return ((a>b)?a:b);}int min(int a, int b){return ((a}

2015-10-15 15:50:11 229

转载 动态地分配内存

#includeusing namespace std;void main(){  char ch='A';  int *p1;  p1=new int(100);  cout  delete p1;}/*-------------------------------------------------●动态分配符○new 和dele

2015-10-15 15:31:07 299

转载 指针的应用

#includeusing namespace std;void main(){  int *x,*y,*temp;  int a,b;  x=&a;  y=&b;  cin>>a>>b;  temp=x;  x=y;  y=temp;  cout   cout     cout   cou

2015-10-15 15:16:36 211

转载 指针设计类和对象回应程序

#includeusing namespace std;void main(){  int a,b;  int *x,*y,*temp;  cin>>a>>b;  x=&a;  y=&b;  temp=x;  x=y;  y=temp;  cout}

2015-10-15 15:06:40 206

转载 指针

#include#includeusing namespace std;class Welcome{private:char *str;public:void Talk();};void Welcome::Talk(){ str=new char[100]; for(;;) {coutgets(str);i

2015-10-15 14:59:44 199

转载 指针设计类和对象回应程序

#include #include using namespace std;class Welcome{private:char *str;public:void Set(char *);void Display();char *Get();void Talk();Welcome(Welcome&);Welcome(char *str="hi")

2015-10-14 11:43:51 316

转载 this->指针

#include using namespace std;class point{public:int a;int b;point(int x,int y){a=x;b=y;}void output(int a,int b)   {    this->a=a;this->b=b;   }void output()

2015-10-14 10:39:22 368

转载 使用指针变量

#includeusing namespace std;int main(){ int a[10]; int i,*p; for(i=0;ia[i]=i+1; for(p=a;pcout cout return 0;}

2015-10-14 10:16:05 304

转载 使用数组名和指针运算

#includeusing namespace std;int main(){  int a[10];  int i;  for(i=0;i  {    a[i]=i+1;cout    }  cout  return 0;}

2015-10-14 10:03:16 415

转载 拷贝对象资源,this指针

#includeusing namespace std;class student{public:student(char *pName="no name",int ssID=0){ id=ssID; name=new char[strlen(pName)+1]; strcpy(name,pName); cout};void copy

2015-10-13 10:25:07 330

转载 字符整型指针

#includeusing namespace std;void main(){struct test{char *str;int *ip;}x;x.ip=new int;*(x.ip)=100;coutdelete x.ip;x.ip=new int[5];for(int i=0;i*(x.ip+i)

2015-10-13 09:47:52 279

转载 结构指针和数组

#includeusing namespace std;void main(){struct human{char name[10];int sex;int age;};human x[]={{"weiping",1,30},{"lihuan",1,25},{"liumin",0,23}};human *p=NULL;for(int i=0;i

2015-10-12 09:49:50 223

转载 改变指针指向的字符内容、动态分配字符型指针变量内存空间

#includeusing namespace std;int main(){ char str[10]; char *strip=str; cout cin>>str; cout cout cout cin>>strip; cout cout *(strip+2)='|'; cout cout strip=new cha

2015-10-12 09:32:38 470

转载 指针赋值、自增自减、组合和关系运算

#includeusing namespace std;int main(){int a[]={1,2,3,4,5,6};int *ip1,*ip2;ip1=a;ip2=ip1;coutcout    ip1++;ip2+=4;coutcoutint n=ip2>ip1;coutcout    n=

2015-10-08 11:51:24 395

转载 二元数组中的指针

#includeusing namespace std;int main(){  int a[2][3],i,j;  int *ip;  for(i=0;i for(j=0;j {   coutcin>>a[i][j]; } ip=&a[0][0];  for(i=0;i for(j=0;j { cout

2015-10-08 11:34:07 418

转载 指针工作原理

#includeusing namespace std;int main(){  int a,b,*ip;  a=456;  ip=&a;  cout  cout  cout  ip=&b;  b=123;  cout  cout  cout  cout  cout  cout  cout  cou

2015-10-08 11:19:43 901

转载 拼接两个顺序文件a.txt和b.txt的内容,结果保存在a.txt(未成功)

#include#include#include#includeusing namespace std;int main(){  char str[100];  int i=0,rsLength=0,rs2Length=0;  fstream rs;  rs.open("a.txt",ios::app);  if(!rs)  {   co

2015-09-30 13:32:45 654

转载 显示(读取)文件大小

#include#includeusing namespace std;void main(){ char fname[365]; cout cin>>fname; ifstream rs(fname,ios::app|ios::in); try {   if(rs.fail())  throw "error!"; } catch(char

2015-09-30 11:26:52 247

转载 浏览文本文件

#include#include#include#includeusing namespace std;int main(){   fstream rs;  char fn[150],buf[1000];  cout  cin>>fn;  rs.open(fn,ios::app|ios::in);  if(!rs)  {    c

2015-09-30 11:13:25 257

转载 复制文件

#include#includeusing namespace std;int main(){  fstream rs,rs2;  char f1[100],f2[100],ch;  cout  cin>>f1;  cout  cin>>f2;  rs.open(f1,ios::in);  rs2.open(f2,ios::out);  whil

2015-09-30 10:21:37 1115

转载 read()从二进制文件读取指定记录号的数据

#include#includeusing namespace std;int main(){ int i=0,a[10];// int a[10]={0};//for(int i=0;i<9;i++)//{//a[i+1]=a[i]*20+i+1;//cout<<a[i]<<endl;//}//ofstream rs1("ok2002com.txt

2015-09-30 10:02:47 2243

转载 write()二进制方式写文件

#include#includeusing namespace std;int main(){int a[10]={0};for(int i=0;i{a[i+1]=a[i]*10+i+1;cout}ofstream rs("ok2002com.txt");ofstream rs2("ok2002com.bin",ios::binary);for(

2015-09-30 09:46:24 3430

转载 删除文件夹(目录)

#include//C++ 删除文件夹源码,C++ 删除目录源程序#includeusing namespace std;int main(){  //if(mkdir("c:\\ok2002com")) // cout if (rmdir("c:\\ok2002com")==-1)  cout else//在D盘删除名为ok2002com的文件夹

2015-09-29 17:01:37 364

转载 读取当前所在目录(文件夹)(C/C++源程序)

#include#include#define MAX_PATH 250using namespace std;int main() {   char *p,str[MAX_PATH];   if((p=getcwd(str,MAX_PATH))==NULL)    {     cout    }   else   {    cout

2015-09-29 17:00:31 1011

转载 更改目录,返回指定文件夹(C/C++源程序)

#include#includeusing namespace std;int main(){ if(chdir("C:\\ok2002")) {   cout }}

2015-09-29 16:59:22 351

转载 put()函数把数据顺序写入文件

#include#include using namespace std; int main() {  char *str="http://www.ok2002.com";  ofstream rs;  rs.open("c:\\file3.txt",ios::out);  if(!rs)  {   cout    return 0;  }  f

2015-09-29 16:55:38 435

转载 get()函数读顺序文件(C/C++源程序)

#include#includeusing namespace std;int main(){ char str[100]; int i=0; ifstream rs; rs.open("file2.txt",ios::in); if(!rs) {  cout  return 0; } while(rs) {  rs.get(str[

2015-09-29 16:54:05 588

转载 定义文件流对象,统计字符个数(C/C++源程序)

#include#includeusing namespace std;int main(){ char *str=" I study C++ in ok2002.com"; int count_k=0,count_all=0; ofstream rs; rs.open("ok2002.txt",ios::out); if(!rs)  cout for(

2015-09-29 16:52:06 411

转载 文件逆序(倒读),文件长度

#include#includeusing namespace std;int main(){ int i=0,j=0,len=0; char str[100]; ifstream rs("ok2002com.txt"); if(!rs)  cout while(rs>>str[i]) {  len++;     i++; } cout

2015-09-29 16:43:36 627

原创 个人博客开启(导语篇)

因在学习C/C++过程中遇到一些问题,为便于以后查阅和保存近日开启个人博客。      之前在论坛或者网站上看到一些代码有误或者VS版本问题变出错,特记录自己学习过程中修改并调试成功的程序源码,为不产生不必要的纠纷与麻烦顾所有帖子均注明为转载。--------2015年9月29号

2015-09-29 16:42:17 305

Node.js实战 第2季 [吴中骅著].pdf

《Node.js实战(第2季)》通过7个实例分别讲解了Node.js在实战开发中的应用,这些章节既涉及Docker、Koa 等全新技术,也涉及OAuth2、命令行工具、消息队列、单元测试、编写C/C++模块等实战中经常会遇到的问题和应用场景。本书章节大体按照从简单到复杂的难度编排,每一章都通过一个实例指引读者从头开发一个Node.js应用,让读者循序渐进地学习Node.js,以及在实战开发中的编程技巧。本书不但着重讲解了每个实战案例所涉及的基础知识、思路和方法,也详细解释了源码的关键部分,希望有利于读者的学习和理解。   《Node.js实战(第2季)》适合有一定Node.js基础及服务器端开发基础的读者阅读,也适合想了解Node.js可以做什么、想迅速上手实践的读者阅读。

2018-05-03

《手把手教你学51单片机》教材pdf

高清珍藏学习嵌入式开发入门最好资料《手把手教你学51单片机》教材pdf

2018-01-04

《手把手教你学51单片机》源码

《手把手教你学51单片机(C语言版)》教材中所有例程与作业习题的源代码

2018-01-04

面试读-经典嵌入式面试题

预处理器(Preprocessor) 1 . 用预处理指令#define 声明一个常数,用以表明1年中有多少秒(忽略闰年问题) #define SECONDS_PER_YEAR (60 * 60 * 24 * 365)UL 我在这想看到几件事情: ?; #define 语法的基本知识(例如:不能以分号结束,括号的使用,等等) ?; 懂得预处理器将为你计算常数表达式的值,因此,直接写出你是如何计算一年中有多少秒而不是计算出实际的值,是更清晰而没有代价的。 ?; 意识到这个表达式将使一个16位机的整型数溢出-因此要用到长整型符号L,告诉编译器这个常数是的长整型数。 ?; 如果你在你的表达式中用到UL(表示无符号长整型),那么你有了一个好的起点。记住,第一印象很重要。 2 . 写一个"标准"宏MIN ,这个宏输入两个参数并返回较小的一个。 #define MIN(A,B) ( (A) <= (B) ? (A) : (B) ) 这个测试是为下面的目的而设的:

2018-01-04

C语言嵌入式典试题全部在这里

C语言嵌入式常见经典试题局部变量可以与全局变量同名,在函数内引用这个变量时,会用到同名的局部变量,而不会用到全局变量。对于有些编译器而言,在同一个函数内可以定义多个同名的局部变量,比如在两个循环体内都定义一个同名的局部变量,而那个局部变量的作用域就在那个循环体内 2、如何引用一个已经定义过的全局变量? 答:extern 可以用引用头文件的方式,也可以用extern关键字,如果用引用头文件方式来引用某个在头文件中声明的

2018-01-04

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除