如何理解以下定义:1、typedef CHAR *LPSTR, *PSTR;

解决方案 »

  1.   

    参考理解 typedef int niuxx;char 等于*lpstr;
      

  2.   

    typedef CHAR *LPSTR;
    typedef CHAR *PSTR;
      

  3.   

    typedef CHAR *LPSTR, *PSTR;
    这个typedef CHAR *PSTR;是怎么等效出来的呢,真是费解
      

  4.   

    typedef type-declaration synonym;The typedef keyword defines a synonym for the specified type-declaration. The identifier in the type-declaration becomes another name for the type, instead of naming an instance of the type. You cannot use the typedef specifier inside a function definition.A typedef declaration introduces a name that, within its scope, becomes a synonym for the type given by the decl-specifiers portion of the declaration. In contrast to the class, struct, union, and enum declarations, typedef declarations do not introduce new types — they introduce new names for existing types.Example// Example of the typedef keyword
    typedef unsigned long ulong;ulong ul;     // Equivalent to "unsigned long ul;"typedef struct mystructtag
    {
       int   i;
       float f;
       char  c;
    } mystruct;mystruct ms;   // Equivalent to "struct mystructtag ms;"typedef int (*funcptr)();  // funcptr is synonym for "pointer
                               //    to function returning int"funcptr table[10];   // Equivalent to "int (*table[10])();"
      

  5.   

    typedef 张华 张三;起了这个外号后,就这个人张三也行,张华也行。编译器都认识。
      

  6.   

    typedef (CHAR *) LPSTR;
    typedef (CHAR *) PSTR;
      

  7.   

    typedef CHAR *LPSTR, *PSTR;应该写成:  typedef CHAR *LPSTR, CHAR  *PSTR;为什么少一个CHAR呢,关键是想问问这个。