By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,227 Members | 1,386 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,227 IT Pros & Developers. It's quick & easy.

value context

P: n/a
What is meant by value context ?

I could not find the definition for value context in

http://www.open-std.org.jtc1.sc22.wg...docs.n1124.pdf

Mar 11 '07 #1
Share this Question
Share on Google+
3 Replies


P: n/a
su**************@yahoo.com, India wrote:
What is meant by value context ?

I could not find the definition for value context in

http://www.open-std.org.jtc1.sc22.wg...docs.n1124.pdf
Just about everything about C has been discussed previously in this
group, at one time or another. You should try a search of Google
Group's archive of this group before posting. Here's a good
explanation by Chris Torek:

<http://groups.google.com/group/comp.lang.c/msg/687fcae0d3ecb089>

Mar 11 '07 #2

P: n/a
su**************@yahoo.com, India said:
What is meant by value context ?
It is not a formal term. When people on this newsgroup use it, they
generally mean:

(a) we're not talking declaration or definition of the object in
question, AND
(c) we're not talking assignment TO the object, AND
(c) we're not talking sizeof, AND
(d) we're not talking &.

Just about all that remains is the use of the name of an object to
indicate that we want to read its value. This is important for arrays:

int foo[] = { 1, 2, 3 }; /* not a value context for foo */
size_t s = sizeof foo; /* not a value context for foo */
int (*ap)[3] = &foo; /* not a value context for foo */
int *ip = foo; /* this *is* a value context */
I could not find the definition for value context in

http://www.open-std.org.jtc1.sc22.wg...docs.n1124.pdf
Right. It is not a formal term. It's just something that everybody knows
(except for those who don't know, of course - which is why asking
questions is such a good idea).

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at the above domain, - www.
Mar 11 '07 #3

P: n/a
Richard Heathfield <rj*@see.sig.invalidwrites:
su**************@yahoo.com, India said:
>What is meant by value context ?

It is not a formal term. When people on this newsgroup use it, they
generally mean:

(a) we're not talking declaration or definition of the object in
question, AND
(c) we're not talking assignment TO the object, AND
(c) we're not talking sizeof, AND
(d) we're not talking &.

Just about all that remains is the use of the name of an object to
indicate that we want to read its value. This is important for arrays:

int foo[] = { 1, 2, 3 }; /* not a value context for foo */
size_t s = sizeof foo; /* not a value context for foo */
int (*ap)[3] = &foo; /* not a value context for foo */
int *ip = foo; /* this *is* a value context */
>I could not find the definition for value context in

http://www.open-std.org.jtc1.sc22.wg...docs.n1124.pdf

Right. It is not a formal term. It's just something that everybody knows
(except for those who don't know, of course - which is why asking
questions is such a good idea).
And to describe it using a formal term that *is* found in the
standard, a value context is an expression context that doesn't
require an lvalue.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <* <http://users.sdsc.edu/~kst>
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
Mar 11 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.