-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Michael wrote:
> Hi all,
>
> I have the following in main:
>
> char output[100];
>
> function(output);
>
> void function(char *out){
>
> .......lots of good stuff....
>
> out = "result is ";
> out[strlen("result is ") + 1] = '\0';
> }
>
> Why does the assignment of 'out' work, but the out[] not work (access
> violation at run time)?
Think of what your assignment statement does. Hint: it modifies
something. What sort of something does it modify?
- --
Lew Pitcher, IT Specialist, Corporate Technology Solutions,
Enterprise Technology Solutions, TD Bank Financial Group
(Opinions expressed here are my own, not my employer's)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (MingW32)
Comment: Using GnuPG with Mozilla -
http://enigmail.mozdev.org
iD8DBQFEjWb7agVFX4UWr64RAk5kAJ9/cmAPUaFL+64clxYTrCYBZ7xZlQCeKRqo
cVQCjYwDrv/zckdca6Mx3oM=
=NAXf
-----END PGP SIGNATURE-----