随笔分类 - C语言
摘要:#include <stdio.h> int main(int argc, char *argv[]) { int a[10]={ 0,1,33,200,45,34,89,90,23,13 }; int i,j; int temp; for(i=0;i<10;i++) { for(j=i+1;j<1
阅读全文
摘要:#include "stdio.h"typedef enum weekday{sun,mon,tue,wed,thu,fri,sat} week;typedef enum ledstate{on,off,tri} state;void main(){week a,b,c,d;state ledon,
阅读全文
摘要:#include "stdio.h" #include //#if 0void func(char *s){ printf(s);} //#endiftypedef struct {int age;char *name;void (*func)();}student;int main(void){s...
阅读全文
摘要:#include #include int main(void) { union result { float d; unsigned char data[4]; }r1,r2; // 特别需要注意的是在单片机中int float double 类型的字长和PC机中是不一样的,需要注意 ...
阅读全文
摘要:CC=arm-linux-gcctarget=testsource=test.call: $(target)$(target): $(source)$(CC) -o $@ $<.PHONY:cleanclean:rm -f ~.* test
阅读全文
摘要:#ifdef DEBUG #define debug(fmt,args...) printk(fmt ,##args) #define debugX(level,fmt,args...) if (DEBUG>=level) printk(fmt,##args); #else #define debu...
阅读全文
摘要:#include "stdio.h"void set(int *ch,int a,int *c,int *d){ c[0]=12; c[1]=133; c[2]=14; ch[0]=ch[0]+1; ch[2]=ch[2]+1; ch[1]=ch[1]+1;*d=10;}void main(){ ...
阅读全文
摘要:typedef unsigned char UCHAR;typedef unsigned char BOOL;/* 计算cnt字节数据的crc,最后一个字节的低7比特必须是0,实际上求的是(cnt×8-1)比特数据的crc */UCHAR CRC7_Cal(UCHAR *pSrc, UINT32 c...
阅读全文
摘要:#include "stdio.h"/*int* set(int a,int *c){int *b;b=malloc(sizeof(int)*3);c[0]=a;c[1]=1+a;c[2]=2+a;b[0]=13;b[1]=14;b[2]=15;return b;}*/char *set(void)...
阅读全文
浙公网安备 33010602011771号