How to judge whether the variable naming conforms to the Hungarian nomenclature prefix Please everyo

Updated on healthy 2024-03-01
6 answers
  1. Anonymous users2024-02-06

    See Lin Rui's Software Engineering

    The Hungarian nomenclature was advocated by Microsoft [Maguire 1993], and although it is cumbersome, it becomes natural to use it. No one forces you to adopt a nomenclature, but one thing you should do: you have to name your programs consistently.

    Here's the naming convention I used when programming:

    1) Macro definitions are represented by uppercase letters and underscores, such as max length;

    2) Functions are composed of words that start with capital letters, such as setname, getname;

    3) pointer variable with the prefix p, e.g. *pnode;

    4) bool variable with the prefix b, such as bflag;

    5) int variable with the prefix i, such as iwidth;

    6) float variable with the prefix f, such as fwidth;

    7) double variable with the prefix d, such as dwidth;

    8) String variables with the prefix str, such as strname;

    9) Enumerate variables with the prefix e, such as edrawmode;

    10) The member variable of the class is prefixed with m, such as m strname, m iwidth;

    For variables of int, float, and double, if the meaning of the variable name is obvious, do not prefix it to avoid annoyance. For example, the int-type variables i,j,k used for loops ; float-type 3D coordinates (x, y, z), etc.

  2. Anonymous users2024-02-05

    I think variable names can be written in any letter, except for some keywords and function names that are specified in C; Uppercase letters can be used as constants, and are generally used in macro definitions; The capitalization of the first letter of the class name is prescriptive, presumably for the sake of distinguishing; The above is just my understanding, I hope it can help you

  3. Anonymous users2024-02-04

    A naming method, commonly used in databases, with"_"Separated.

    For example: sys user info

  4. Anonymous users2024-02-03

    It's a style:

    int icount;

    char cval;

    float fscore;

    Add the type name to the variable name to make it easy to understand at a glance.

  5. Anonymous users2024-02-02

    Properties Section:

    g Global variables.

    c constant.

    M C++ class member variables.

    s static variable.

    Type part: Array a

    Pointer p-function fn

    Invalid v handle h

    Long integer l Boolean b

    Floating-point (sometimes referred to as a file) f

    Two-word dw string sz

    Short integer n double precision floating-point d

    Count C (usually CNT).

    The character ch (usually with c).

    Integer i (usually n).

    byte by word w real r

    Unsigned uDescription Section:

    Max max

    Min min

    Initialize init

    Temporary variable t (or temp).

    Source object src

    Intent object dest

  6. Anonymous users2024-02-01

    The Hungarian nomenclature is a naming convention when programming. The basic principle is: variable name = attribute + type + object description, in which the name of each object needs to have a clear meaning, and the full name of the object can be taken or part of the name.

    It should be based on the original limb branch rules that are easy to remember and easy to understand. It is very important to ensure the coherence of the name.

Related questions
15 answers2024-03-01

If the assignment is equal to 0, it is true, and if it is not equal to 0, it is false.

11 answers2024-03-01

To be clear, only"Value parameters and variable parameters"How can I help you?

8 answers2024-03-01

Once you have SPSS open, click on the Variable View tab below. Under the Name tab of the variable view, double-click the cell to enter the text in the action line. Press enter after typing, and the following parameters will be automatically generated. >>>More

13 answers2024-03-01

The first time a typhoon was named was the 20th century Australian forecaster Krimhenlange, and the current way of naming typhoons is to make a naming table from the countries and regions surrounding the typhoon.

5 answers2024-03-01

Hello, I am inquiring for you, please wait a while, I will reply to you immediately Dear, hello, I am happy to answer for you. The name dinosaur was coined in 1842 by British paleontologist Richard Owen. >>>More