[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.c++

what are literal values and symbolic and manifest constants?

S Claus

3/31/2009 5:57:00 AM

Hi all

sorry about this but could anyone give me a simple explanation of what
is a "literal" and what is a "symbolic constant" and what is a
"manifest constant"?

Is a literal practically any number or string that you store in a
variable?

And what is the difference between a "symbolic constant" and a
"manifest constant"? Is there any difference?

Thanks in advance
7 Answers

Richard Heathfield

3/31/2009 7:03:00 AM

0

S Claus said:

> Hi all
>
> sorry about this but could anyone give me a simple explanation of
> what is a "literal"

6, 'x', 42.0, "Hello world"

In C99, (int[]){2, 4} is also a literal.

> and what is a "symbolic constant"

EXIT_SUCCESS, EXIT_FAILURE, EOF, BUFSIZ, to name but a few. Here's
how to create them:

#define CM_PER_INCH 2.54
#define PI 4

> and what is a "manifest constant"?

6, 'x', 42.0, "Hello world"

> Is a literal practically any number or string that you store in a
> variable?

No, it's practically any number or string that you see /outside/
variables.

> And what is the difference between a "symbolic constant" and a
> "manifest constant"?

A symbolic constant is a constant that is represented in the code by
a symbol.

A manifest constant is a constant that is made manifest in the code
itself (as opposed to being represented by a symbol).

> Is there any difference?

180 degrees.

--
Richard Heathfield <http://www.cpax....
Email: -http://www. +rjh@
Google users: <http://www.cpax.org.uk/prg/writings/goog...
"Usenet is a strange place" - dmr 29 July 1999

Alf P. Steinbach

3/31/2009 7:03:00 AM

0

* S Claus:
> Hi all
>
> sorry about this but could anyone give me a simple explanation of what
> is a "literal" and what is a "symbolic constant" and what is a
> "manifest constant"?
>
> Is a literal practically any number or string that you store in a
> variable?
>
> And what is the difference between a "symbolic constant" and a
> "manifest constant"? Is there any difference?
>
> Thanks in advance

First, since this is crossposted to 5 groups involving different programming
languages, be very happy that be sheer coincidence you've asked about the
definitions of terms that are used about the same way in all of programming.

Otherwise we'd have had to employ some unsavory characters with ice picks, chain
saws and other equipment, and have them call on you.

Don't cross-post that massively, and ideally: post to one group only.

Now, "literal": that's a value specified directly in the source code.

"symbolic constant": that's a name that denotes a value.

"manifest constant": who knows, google it, check the author's definition. It's
evidently a constant. And evidently it's manifest in some way. :-)


Cheers, hth., and please stop that trollish cross-posting,

- Alf

--
Due to hosting requirements I need visits to <url: http://alfps.izfre....
No ads, and there is some C++ stuff! :-) Just going there is good. Linking
to it is even better! Thanks in advance!

Roedy Green

3/31/2009 8:05:00 AM

0

On Mon, 30 Mar 2009 22:57:01 -0700 (PDT), S Claus
<santa@temporaryinbox.com> wrote, quoted or indirectly quoted someone
who said :

>sorry about this but could anyone give me a simple explanation of what
>is a "literal" and what is a "symbolic constant" and what is a
>"manifest constant"?

See http://mi.../jgloss/li... for literal

http://mi.../jgloss/con... for symbolic constant.

I have never heard of a manifest constant.

There are expressions that can be evaluated at compile time. I have
not heard a short name for them. Perhaps we could call them "manifest
constants" since their value is more obvious than other constants.
--
Roedy Green Canadian Mind Products
http://mi...

"Danish studies of 10,000 birds killed revealed that almost all died in
collisions with buildings, cars and wires; only 10 were killed by windmills.
Alternative energy sources are absolutely necessary.
Global warming will kill birds and bats, as well as other species,
in much greater numbers than wind power."
~ Dr. David Suzuki

red floyd

3/31/2009 1:34:00 PM

0

Roedy Green wrote:
> On Mon, 30 Mar 2009 22:57:01 -0700 (PDT), S Claus
> <santa@temporaryinbox.com> wrote, quoted or indirectly quoted someone
> who said :
>
>> sorry about this but could anyone give me a simple explanation of what
>> is a "literal" and what is a "symbolic constant" and what is a
>> "manifest constant"?
>
> See http://mindprod.com/jgloss/li... for literal
>
> http://mindprod.com/jgloss/con... for symbolic constant.
>
> I have never heard of a manifest constant.
>

I believe manifest constants are symbolic constants that are defined by
the implementation.

e.g.:

__unix__, etc...

Lew

3/31/2009 3:27:00 PM

0

S Claus wrote:
> sorry about this but could anyone give me a simple explanation of what
> is a "literal" and what is a "symbolic constant" and what is a
> "manifest constant"?
>
> Is a literal practically any number or string that you store in a
> variable?
>
> And what is the difference between a "symbolic constant" and a
> "manifest constant"? Is there any difference?

One minute of googling brought me to
<http://en.wikipedia.org/wiki/Variable#Con...

Punching "literal" into Wikipedia's own search took another two
minutes to get me to
<http://en.wikipedia.org/wiki/Object_l...

Practice your google-fu, Grasshopper.

--
Lew

=?ISO-8859-1?Q?Arne_Vajh=F8j?=

3/31/2009 11:11:00 PM

0

red floyd wrote:
> Roedy Green wrote:
>> On Mon, 30 Mar 2009 22:57:01 -0700 (PDT), S Claus
>> <santa@temporaryinbox.com> wrote, quoted or indirectly quoted someone
>> who said :
>>
>>> sorry about this but could anyone give me a simple explanation of what
>>> is a "literal" and what is a "symbolic constant" and what is a
>>> "manifest constant"?
>>
>> See http://mindprod.com/jgloss/li... for literal
>>
>> http://mindprod.com/jgloss/con... for symbolic constant.
>>
>> I have never heard of a manifest constant.
>
> I believe manifest constants are symbolic constants that are defined by
> the implementation.

In C/C++.

Roedy is most likely reading this in the Java group.

Arne

Lew

4/1/2009 4:03:00 AM

0

red floyd wrote:
>> I believe manifest constants are symbolic constants that are defined by
>> the implementation.

Or by the program.

Arne Vajhøj wrote:
> In C/C++.

--
Lew