This code is below
typedef NodoQ *PtrNodoQ; PtrNodoQ ppio, fin;
same as this one?
NodoQ* ppio; NodoQ* fin;
Yes, this leads to exactly the same types of pointers for ppio and fin .
Regarding your comment
"I did not try because I had the second option in my code, and I just did not want to lose some time ..."
You can easily test it:
void foo(PtrNodoQ p) { } void bar(NodoQ* p) { foo(p); }
and
void baz() { NodoQ n; foo(&n); bar(&n); }
compile everything perfectly, without invalid warnings or type conversion errors.
Also you could quickly find the answer in this excellent link (my attention):
Typedef names are aliases for existing types , and not declarations of new types . Typedef cannot be used to change the value of an existing type name (including typedef-name). After the declaration, the typedef name can only be updated to refer to the same type again. Typedef names are only valid in scope: different functions or class declarations can define types with the same name with different meanings.
source share