自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(11)
  • 资源 (4)
  • 收藏
  • 关注

原创 在mfc中添加控制台,实现printf

#include <io.h>  #include <fcntl.h>void InitConsoleWindow(){AllocConsole();HANDLE handle = GetStdHandle(STD_OUTPUT_HANDLE);int hCrt = _open_osfhandle((long)handle,_O_TEXT);FILE * hf...

2018-09-28 17:36:07 1195

原创 结构体可以直接用=互相赋值,,,!

郁闷了,原来可以直接操作,绕那么大圈void main(){    STU stu1={0,10};    STU temp={12,88};//STU * p1=&stu1;//STU * p2=&temp;printf("%d-%d\n",temp.name,temp.num);    temp=stu1;printf("%d-%d\n",temp.name,...

2018-09-21 16:37:23 17576 2

原创 结构体指针替换

#include<stdio.h>typedef struct {char name;int num;}STU;void change(STU *p1,STU *p2){*p2=*p1;}void main(){    STU stu1={0};    STU temp={12,88};    printf("%d-%d\n",temp.name,te...

2018-09-21 15:39:20 473

原创 结构体强制转换

struct student{int name;int age;}student;typedef struct student* Pstu;void main(){    int a[2]={15,16};    printf("%d",((Pstu)a)->name);    printf("%d",((Pstu)a)->age);}结果:还可...

2018-09-17 20:14:13 2375

原创 结构体指针必须用->

 struct student{int name;int age;}student;typedef struct student* Pstu;void main(){Pstu p;//变量定义p->name=0;p.age=0;}compile:error C2231: '.age' : left operand points to 'struct', use...

2018-09-17 19:46:50 3794

原创 static

fun.cwchar.c一个c文件调用另一个c文件的函数,包含static变量的情况是没问题的。

2018-09-17 19:41:49 134

原创 二维数组malloc与free

特别适用于C语言动态字符串数组操作#include <stdio.h>typedef unsigned int wchar;#define LENGTH 10//需求:字符串数组的二维数组动态开辟//name[n][LENGTH]  。。。。。。。。。。//                   。。。。。。。。。。//                   。。。。。...

2018-09-17 18:52:11 5411

原创 同级传递形参达不到想要效果,平级指针传递也不行

#include <stdio.h>typedef unsigned int wchar;int i=9;//全局变量,指针固定int * changeptr(int * p)//指针加1{p=p+1;return p;}void main(){    int *addr=&i;    printf("%d\-%d\n",&i,i);...

2018-09-17 18:15:15 206

原创 malloc和free在两个函数中实现

char* creat(void){    char* p=(char*)malloc(sizeof(char)*10);    return p;}void del(char *p){    free(p);    p=NULL;}int main(){    del(creat());} 通过指针传递,    p=NULL;这句是精华,工程做的好的会把p赋...

2018-09-17 17:28:01 947

原创 结构体指针做形参(两个结构体互换)

对比两个程序就懂啦,我真聪明,竟然想出这种直接互换结构体的方法程序一:#include <stdio.h>typedef struct{char num1;char num2;}INFO; INFO * info=NULL; INFO * info1=NULL;void changep(INFO* p1,INFO* p2){INFO *p;p=p1;...

2018-09-13 14:40:56 8033 2

原创 malloc与直接定义变量的区别

//vc6.0编译环境下代码#include "stdio.h"#include "malloc.h"#define N 5 //malloc申请内存 int *function1(){    int i;    int *a=(int *)malloc(sizeof(int)*N);    for(i=0;i<N;i++)    {        a[i]=i+1;...

2018-09-06 13:56:28 2207

ucos3消息队列简单应用举例(keil5工程压缩包)

task1发送一串数据,task2等待接收此数据串,接收到后通过串口1发送出来。详细说明见博客:https://blog.csdn.net/m0_37738150/article/details/80817336

2018-06-26

简单串口收发功能的MFC工程

vc++6.0的MFC工程,参考网络教程,自己动手完成的串口收发上位机,适合初学者理解建立类向导的过程,重点说明见博客:https://blog.csdn.net/m0_37738150/article/details/80816657

2018-06-26

基于stm32f103VET的ucosIII/ucos3工程keil5,可以直接编译下载,自己动手亲测可用

创建了两个任务,在主任务中创建子任务,可以看到两个LED灯闪,可以继续添加任务。

2018-06-19

stm32f103串口BootLoader工程及APP工程(自己动手,亲测可用)

stm32f103串口BootLoader工程及APP工程,完整可以做实验,上位机用SecureCrt

2018-03-09

空空如也

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

TA关注的人

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