I have a basic pointer question. I have some code like this: Please let me know if anything is wrong in the following code:
struct abc {
int a;
int b;
};
void func2(int*); // defined elsewhere
void func1 (struct abc *p1)
{
struct abc var1 = *p1; // ======> Can I do this ?
func2(&var1.b);
func2(&p1->b); // =========> Which of these 2 is right ?
}
func2()?