in Programming in C
4,017 views
1 vote
1 vote
consider the two declarations

void *voidPtr;

char *charPtr;

which of the following assignments are syntactically correct?

(a)charPtr= voidPtr

(b)*charPtr=voidPtr

(c)*voidPtr=*charPtr

(d)voidPtr=charPtr

 

please explain!
in Programming in C
4.0k views

4 Comments

@Shaik

I mean one memory adress is copying in another pointer variable

where practically we need to do this?

0
0

is it like call by reference?

Yes kind of.. but like in call by ref, the pointer can manipulate the value by de-referencing but in this case we cannot change value of c by *voidPtr.

1
1

where practically we need to do this?

we can use, void pointer for implementing function overloading in C

1
1

1 Answer

0 votes
0 votes
voidptr = charptr

Related questions