Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
QM handling of C declarations
#6
Quote:int**y =&p
&y = memoruy adress of y
y=memory address of p
*y = memory address of u
**y=value of u = 3

So i don't get the meaning of using str*&...

Less * and & in code.
In C/C++ also easier to access members. C++ example with *&: x->m. C++ example with **: (*x)->m. QM does not have -> and instead allows x.m in all cases where possible.

-----------------

Type PMIB_IPINTERFACE_ROW probably is a typedef or #define for MIB_IPINTERFACE_ROW*. Like the famous LPSTR actually is char*. When you see P or LP at the beginning of a type name in C/C++ code, it is probably a pointer. Microsoft always uses this naming convention.

Quote:the PMIB_IPINTERFACE_ROW row variable which must be filled is not declared anywhere
I see that the callback calls interfaceChanged(), which calls GetIpInterfaceEntry() (WinAPI) and passes the same row variable, not another MIB_IPINTERFACE_ROW variable.

3. Use as pointer. Or replace MIB_IPINTERFACE_ROW*Row to MIB_IPINTERFACE_ROW&Row and use as reference. When accessing members, in QM it is the same in both cases: Row.member.


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)