什么是的typedef类型和同类型的指针的正确方法? [英] What is the right way to typedef a type and the same type's pointer?

查看:101
本文介绍了什么是的typedef类型和同类型的指针的正确方法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是的typedef类型和同类型的指针的正确方法?这里是我的意思。我应该这样做:

What is the right way to typedef a type and the same type's pointer? Here is what I mean. Should I do this:

typedef unsigned int delay;
typedef unsigned int * delayp;

或者我应该这样做:

Or should I do this:

typedef unsigned int delay;
typedef delay * delayp;

或许我不应该在所有的typedef指针,只是使用延迟* 而不是 delayp 到处都是,我觉得有必要?

Or perhaps I should not typedef pointer at all and just use delay * instead of delayp everywhere I find necessary?

谢谢,博大Cydo。

推荐答案

正确的方法是不这样做。隐藏事实的东西是一个指针通常被视为不良作风。

The right way is not to do it. Hiding the fact that something is a pointer is commonly seen as bad style.

这篇关于什么是的typedef类型和同类型的指针的正确方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆