在《The C++ Programming Language》这本书中,有这样一段话:
-----------------------------------------------------------------
The name of a structure type can be used before the type is defined as long as that use does not require the name of a member or the size of the structure to be known. for example:Class S;
S f();
void g(S);
S*h( S* );
-----------------------------------------------------------------------
问题:
1.   S f() 里面的S作为函数的返回值类型不用分配空间吗?
2.  Void g(S)中的S作为入参类型不用分配空间吗?
3.  S*h(S*);  这句话是什么意思啊?

解决方案 »

  1.   

    S* h(S* parament);  这你总该认识了吧?难道不知道C++里多余空格都可以省略?
      

  2.   

    2.  Void g(S)中的S作为入参类型不用分配空间吗?
    ========================
    实参完成分配了。
    比如:
    S stest;
    g(stest);3.  S*h(S*);  这句话是什么意思啊?
    =================================
    定义一个 函数 h, 该函数带一个参数 ,类型为 S*, 函数返回一个 S*
      

  3.   

    1.   S f() 里面的S作为函数的返回值类型不用分配空间吗?函数调用是怎么的过程,自己理解一下 ...
    返回的是 S 不是 S* 撒 ...