收藏 分销(赏)

HungarianNotation.doc

上传人:pc****0 文档编号:7837393 上传时间:2025-01-20 格式:DOC 页数:2 大小:44KB 下载积分:10 金币
下载 相关 举报
HungarianNotation.doc_第1页
第1页 / 共2页
HungarianNotation.doc_第2页
第2页 / 共2页
本文档共2页,全文阅读请下载到手机保存,查看更方便
资源描述
Hungarian Notation • Basic Order: [Prefix]-[BaseTag]-Name-[Suffix] • [Prefix]: m_ non-static class data members [ compound ] s_ static data ( module/function scope ) [ compound ] sm_ static class data members [ compound ] g_ global variable [ compound ] • [BaseTag]: p pointers [compound ] pv pointer to a void argument pp pointer to a pointer ref references [ compound ] rg array [ compound ] c count of items h HANDLE, abstract pointer hr HRESULT b BOOL / bool or other flag bt BYTE (unsigned char) v void ch char/TCHAR s short(16 bits) i int l long(32 bits) w WORD (unsigned short) dw DWORD (unsigned long) u any unsigned [ compound ] ui UINT ul ULONG us USHORT f float d double sz CHAR *, string (both null terminated and CString) wsz WCHAR*, Unicode string tsz TCHAR*, Flexible Unicode bstr BSTR/ bstr_t var VARIANT/variant_t e enum variable or parameter vec vector mat Matrix lst list • [Suffix]: _c constant _t suffix for any type ( including enum’s) • Remark. -- Compound means the prefix or suffix is typically used in combination with additional notations. Combine prefixes in the order <reference/pointer><array><modifer><type>. -- There is one notable case where Hungarian usually does not add to the readability of code and that is code doing mathematical computations. In this case, simple names such as x, y, z, i, j, k, etc. can be easier to read and are totally acceptable. Certain abbreviations have become standard abbreviation Word src Source dst Destination rc Rectangle quad Quadrilateral pt Point tx Text ptr Pointer stat Status or state cmd Command id Identifier wnd Window btn Button sel Select or Selection Member Function Names We highly recommend using the following standard prefixes for member function names. Function prefix Type of function F… Query operations that return a bool Get… Gets a property. Set… or Put… Sets a property. Create… Dup… Creates or duplicates a C++ object. Use “Duplicate” for a method that duplicates the object itself. Objects returned by these functions must be disposed with delete. On… After… Protected notification methods usually overridden by clients. Where both On and After methods are provided, On is called prior to the event, and After is called after. Draw… Move… Modifier operations (named with active verb phrases). Swap Swaps the contents of one object with the contents of another in a way guaranteed to succeed and not throw an exception. For convenience, most useful network addresses and internal websites are listed: Corporate portal site http://msw MSR Web http://msrweb/search/mssearch.asp MSR info web http://msrinfo Internal Technical Education http://mste     Software \\msrcnx\software; \\bjs-dds-01\products Toolbox http://toolbox/ Productivity http://productivity/ Source Depot http://tools/ToolCenter/SrcDptToolCtr.asp RAID http://tools/ToolCenter/RaidToolCtr.asp ITG web http://itgweb/ Microsoft Public download MSDN 2
展开阅读全文

开通  VIP会员、SVIP会员  优惠大
下载10份以上建议开通VIP会员
下载20份以上建议开通SVIP会员


开通VIP      成为共赢上传

当前位置:首页 > 百科休闲 > 其他

移动网页_全站_页脚广告1

关于我们      便捷服务       自信AI       AI导航        抽奖活动

©2010-2026 宁波自信网络信息技术有限公司  版权所有

客服电话:0574-28810668  投诉电话:18658249818

gongan.png浙公网安备33021202000488号   

icp.png浙ICP备2021020529号-1  |  浙B2-20240490  

关注我们 :微信公众号    抖音    微博    LOFTER 

客服