用函数指针替代Switch/Case语句的程序设计方法  被引量:1

Programming Method Using Function Pointer to Replace Switch/Case Sentence

在线阅读下载全文

作  者:龚松显 董锐 刘跃宣 

机构地区:[1]总参通信训练基地教研部,宣化075100

出  处:《单片机与嵌入式系统应用》2014年第9期14-15,共2页Microcontrollers & Embedded Systems

摘  要:单片机程序中,当Switch/Case语句分支较多、处理代码较长、处理情况较为复杂时,逻辑修改和程序调试均存在一定的困难。针对该问题,本文给出了使用函数指针替代Switch/Case语句的实现思路以及相对应的代码模型,为其他类似的代码实现提供参考。In MCU programs, when Switch/Case sentence has many branches,the code is very long and the situation is complex, logic modification and program debugging have many difficulties. Aiming at this problem, using function pointer to replace Switch/Case sentence is proposed and related code model is given. The method offers the reference to other similar codes.

关 键 词:单片机程序 SWITCH CASE 函数指针 

分 类 号:TP311.1[自动化与计算机技术—计算机软件与理论]

 

参考文献:

正在载入数据...

 

二级参考文献:

正在载入数据...

 

耦合文献:

正在载入数据...

 

引证文献:

正在载入数据...

 

二级引证文献:

正在载入数据...

 

同被引文献:

正在载入数据...

 

相关期刊文献:

正在载入数据...

相关的主题
相关的作者对象
相关的机构对象