Hey group!
I have 2 questions. I saw functions with char *dst = (char *)src. In
that case if I remember what I've learned I assign (an) (the) address
of src to dst. Right?
But I can assign an address with the address operator & too? char *dst
= &src.
What's the difference between *dst = (char *)src and *dst = &src and
what's the recommended style?
2. The same thing with returning a pointer from a function. If i write
a version of strchr i can return a pointer like
return ptr OR
return (char *)ptr.
I would think in both cases I'll return a pointer(address )
Thanks for any help
Tom
I have 2 questions. I saw functions with char *dst = (char *)src. In
that case if I remember what I've learned I assign (an) (the) address
of src to dst. Right?
But I can assign an address with the address operator & too? char *dst
= &src.
What's the difference between *dst = (char *)src and *dst = &src and
what's the recommended style?
2. The same thing with returning a pointer from a function. If i write
a version of strchr i can return a pointer like
return ptr OR
return (char *)ptr.
I would think in both cases I'll return a pointer(address )
Thanks for any help
Tom
Comment