⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 inc.h

📁 c 的一些经典算法,满好的,适合初学者. 也可以当作小程序看,对初学者会很有帮助
💻 H
字号:

  #define   uchar unsigned char
  #define   uint  unsigned int 
  #define   FORMAT  "%d\n%s\n%f\n%f\n%f\n"
 

   /*****************待测函数********************************/
/*数据类型的不同下运算效率的不同  */

/*******************************************************************************/
/**验证整型和实型数据的相加 运算的执行效率********/
/******************************************************************************/
         test_char_add();
        test_uchar_add();
        test_int_add() ;
        test_uint_add()  ;
        test_float_add();
        test_double_add();
        test_ldouble_add();

 /*******************************************************************************/
/**验证整型和实型数据的相乘运算的执行效率********/
/******************************************************************************/
 test_int_multiply() ;
 test_float_multiply();
 /*************************************************************************************/
           /* 输出一维数组中元素的三种方法的比较*/
/*************************************************************************************/
void test_1arry_pointer1(void) ;


void test_2arry_pointer1(void) ;



void test_1arry_pointer2(void) ;

       /*用指针变量指向数组元素,++和――运算符用于指针变量时很有效。*/
void test_1arry_pointer3(void)  ;
   /************************************ ********/
/*比较For 和 While循环效率*/
/*********************************** ********/
  void Test_For(void)       ;
  void Test_While(void)    ;
    /************************************ ********/
/*比较两层循环嵌套的IF和Switch 效率*/
/*********************************** ********/
void Test_IF(void)   ;
  void Test_Switch(void) ;
 /************************************ ********/
/*只有一个单层循环的case语句和If语句的比较*/
/*********************************** ********/
void Test_OnlySwitch(int iValue)  ;

void Test_OnlyIF(int iValue)  ;

/***********************************************************/
/*空间换时间的典型做法在for循环中的应用*/
/***********************************************************/

/*改进前*/
int Test_TimeSpace1(uchar k)    ;

/*改进后*/
int Test_TimeSpace2(uchar k)   ;
    /***********************************************************/
/*空间换时间的典型做法在switch中的应用*/
/***********************************************************/
char Test_TimeSpace3 (uchar type)   ;
char Test_TimeSpace4 (uchar type)   ;
   /******************************************************/
/*自加自减复合赋值表达式的效率比较*/
/******************************************************/
   void  Test_AddSub_Self()   ;
   /**********************************************************************************************/
/*减少运算强度*/
/**********************************************************************************************/

/*(只要是求2n方的余数,均可使用位操作的方法来代替)*/
   void  Test_remain()  ;
    /*平方运算的比较*/
     void   Test_equare1()   ;
     /* 只要是乘以或除以一个整数,均可以用移位的方法得到结果 */
/* *比如a=a*9  *****/
   void   Test_equare2()  ;
  /*************************************************************************/
/*自加自减延时生成代码量的比较*/
/***********************************************************************/
      /*通常使用的延时函数均采用自加的形式:*/
    void delay1 (void) ;
    /*改为自减延时是的代码*/
void delay2(void)  ;
/*while循环和do…while循环生成代码量的比较*/
void    Test_while_dowhile1()  ;
void    Test_while_dowhile2()    ;


/****************************************************/
/*用指针做函数参数与非指针做函数参数的比较*/
/****************************************************/

struct student 
{
    int  num;
    char name[10];
    float  score[3];
}stu = {12,"wangli",70,80,90};

void  print1(struct student  );
 void unpointer_func(void) ;
/******************************/

void  print2(struct student  *);

 void pointer_func(void)  ;










⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -