VMS pointer problems continue.
Chris Olson
chris at ssbell.UUCP
Thu Mar 31 23:34:25 AEST 1988
[This line is for line-eaters :-]
In article <12702 at brl-adm.ARPA> Russell_Green.WBST129 at Xerox.COM writes:
>If you change your declaration for b to:
> char *b = "Arf!";
>you should have no further problems.
>
>You apparently wanted a pointer to a character string, you were returning the
>whole string, not a pointer to it. Some compilers are VERY picky!
>
>Good luck,
>
>Russ
The reason was wrong. The solution is correct!
Hmm, what was really happening here was this:
Please store the 4-byte quantity representing the
address of the string "Arf!" into the 1 byte quantity
represented by the variable b. Since there is no room for
this large quantity, please truncate to fit.
Needless to say, on a VAX under VMS, the first page of
memory (0x00 - 0xff) is off limits to non-priviledged
processes.
Remember: "Pointers are the root off all evil in C, and also
the root of all successes!"
[+][+][+][+][+][+][+][+][+][+][+][+][+][+][+][+][+][+][+][+][+][+][+][+][+]
Chris Olson O
(aka, Lord Valentine, OXXXXI>>>>>>>>>>>>>>>>>>>>>>>>
Electric Samurai, O
& other foolishness)
(chris at cbosgd!ohgua!ugn!ssbell)
More information about the Comp.lang.c
mailing list