首页 > 其他 > 详细

Stub Functions

时间:2020-05-16 10:19:22      阅读:38      评论:0      收藏:0      [点我收藏+]

A stub is just an empty function. It‘s a quick way to create a skeleton of your final program.

You may add the print output to ensure that all your stubs get implemented.

Your stubs may or may not take an argument but they usually will return something.

Stub functions are typically functions which have been defined but have no real code in them. For example the function below might be a stub...

string printMessage() {
   return "";
}

 

This function really does nothing but return an empty string. It is a stub, as in a place where we will fill in code later but have not done it yet. You may also know these as "skeleton functions". They are meant as place holders and in some systems they may even have you create a stub function that when linked with a library it will encounter the stub and fill in the details turning the stub above into something like...

string printMessage() {
   return "Hello from my a library";
}

 

Stub Functions

原文:https://www.cnblogs.com/JasperZhao/p/12898155.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!