c-equivalent of "reference" and "reference to a pointer"

Could someone please let me know the c-equivalent of:
1) reference?
2) reference to a pointer "*&"?

In other word, if my function is like this in CPP:

1
2
3
4
5
void func(int& p, int*& pr)
{
    p++;
    pr++;
}



How would I change the both while converting it in C?

Last edited on
@TarikNeaj

Thanks for responding.

Let me first summarize what I know and confusions that I have:

What I know:

1) A pointer can be re-assigned any number of times while a reference can not be re-seated after binding.

2) Pointers can point nowhere (NULL), whereas reference always refer to an object.

3) You can't take the address of a reference like you can with pointers.

4) There's no "reference arithmetics" (but you can take the address of an object pointed by a reference and do pointer arithmetics on it as in &obj + 5).

Confusion:
1) I remember reading somewhere that C++ compiler implements references as pointers. Could someone please elaborate?

2) Now, if some code involves "pointer-to-pointer" or "reference-to-pointer", I get totally lost. Could someone also elaborate?



Last edited on
Topic archived. No new replies allowed.