Path: utzoo!utgpu!water!watmath!clyde!att-cb!att-ih!pacbell!ames!mailrus!umix!uunet!btni!mcmi!ssbell!chris From: chris@ssbell.UUCP (Chris Olson) Newsgroups: comp.lang.c Subject: Re: VMS pointer problems continue. Message-ID: <239@ssbell.UUCP> Date: 31 Mar 88 13:34:25 GMT References: <12702@brl-adm.ARPA> Reply-To: chris@ssbell.UUCP (0000-Chris Olson) Organization: Sterling Software, FSG-IMD, Bellevue, NE. Lines: 36 [This line is for line-eaters :-] In article <12702@brl-adm.ARPA> Russell_Green.WBST129@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@cbosgd!ohgua!ugn!ssbell)