From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: To: 9fans@9fans.net From: "Grant R. Mather" Date: Thu, 13 Feb 2014 18:38:46 -0700 In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Subject: Re: [9fans] Strings in acid, what am I missing? Topicbox-Message-UUID: b9f10a78-ead8-11e9-9d60-3106f5b1d025 > the reason that the () are required > is that * binds tighter than \s in acid. one thing that's confusing about > acid is main:ca is an *address* of main:ca, not its value. so *main:ca > is the pointer into the bss, and main:ca is the address of that pointer. So if I understand you correctly, in acid main:ca is the equivalent to char ** in C? And furthermore that the \s expression operates on acid addresses rather than normal char * in C? From trying things out in acid a little bit, it seems like this is the case, but I'm not positive. > the reason cp gives you garbage is it's not initialized. in fact when > i compile this for am64, you can see everthing quite clearly. it is > optimized away! (it's a good question why a char* is treated differently > than a char[]. perhaps there is some dark corner of the standard that > implies things.) I see what you're saying about cp not being initialized, but I compiled with the -N option and I assumed that this would rectify the situation of things being optimized away. Interestingly enough if I do **main:cp\c in acid it gives me 'W', but *(main:cp\s) gives me garbage, whereas *(main:ca\s) gives me "Hello". Thanks for the response, any other help would be appreciated!