Re: Incompatible pointer type warning issued for pointers to structures with compatible first element

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



In the example you give, it's really not much more typing to write

    strcpy (pStruct->string, "Hello");

instead of

    strcpy (pStruct, "Hello");

with the additional advantage of being more legible.

(btw, in your example, you're copying 6 chars ("Hello\0")
into a char array that is only 5 chars long.)

jlh

Attachment: signature.asc
Description: OpenPGP digital signature


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux