Turbo C

A

alfi benson

Hi,
I'm a student of IUT.I want to know about operators.
Any reply will be appreciated.

ALFI
095436
CEE
 
M

Malcolm McLean

Hi,
I'm a student of IUT.I want to know about operators.
Any  reply will be appreciated.
With a few exceptions, operators are basic mathematical functions like
addition or division which we conventionally represent with symbols. C
lacks an exponential operator but has a "pow" fucntion, which
illustrates the essential equivalanence of operators and functions.
A few operators like the indirection operator (*) have no meaning in
standard mathematics but have a programming meaning. One function,
sizeof(), is technically an operator because of the way it evaluates
its argument.
 
S

Seebs

excuse me, language explanation, what is a "follow-up question" please?

A further question asked in response to an answer.

Knock knock.
Who's there? <-- question
Dwayne. <-- answer
Dwayne who? <-- follow-up question

-s
* Qjnlar gur ongugho, V'z qjbjavat.
 
R

Rob Kendrick

Richard Heathfield ha scritto:

excuse me, language explanation, what is a "follow-up question"
please?

A question asked after an answer is provided, in order to obtain
finer-grained more precisely-targeted information.

B.
 
P

Phil Carmody

Richard Heathfield said:
Malcolm McLean wrote:



It isn't a function, it doesn't have an argument, and it doesn't
evaluate anything (except under C99 for VLAs).

And it doesn't necessarily need a pair of round brackets after it,
But apart from that,
you're spot on - it is indeed technically an operator, just as +, -,
%, and so on are technically operators.

There's one more nit - it's not an operator *because* of the above
things, it's an operator because it's defined to be an operator.

Phil
 
N

Nick Keighley

With a few exceptions, operators are basic mathematical functions like
addition or division which we conventionally represent with symbols. C
lacks an exponential operator but has a "pow" fucntion, which
illustrates the essential equivalanence of operators and functions.
A few operators like the indirection operator (*) have no meaning in
standard mathematics but have a programming meaning. One function,
sizeof(), is technically an operator because of the way it evaluates
its argument.

the following don't correspond to mathematical functions

assignment, comma-operator, address-of, function application, [], *=,
+= (etc.), &&, ||, ->, ., ++, --, ?:

I'd argue *most* C operators don't correspond to well known
mathematical functions.

The following are well known mathematical functions that are library
fuinction and not operators in C

sin, cos, tan, etc.
 
M

Malcolm McLean

With a few exceptions, operators are basic mathematical functions like
addition or division which we conventionally represent with symbols. C
lacks an exponential operator but has a "pow" fucntion, which
illustrates the essential equivalanence of operators and functions.
A few operators like the indirection operator (*) have no meaning in
standard mathematics but have a programming meaning. One function,
sizeof(), is technically an operator because of the way it evaluates
its argument.

the following don't correspond to mathematical functions

assignment, comma-operator, address-of, function application, [], *=,
+= (etc.), &&, ||, ->, ., ++, --, ?:

I'd argue *most* C operators don't correspond to well known
mathematical functions.

The following are well known mathematical functions that are library
fuinction and not operators in C

sin, cos, tan, etc.
A function is any mapping of a set of input parameters to output
parameters. So in fact all the C operators are functions because they
all yield values. The main difference is that the ++/-- and compound
assignment operators also have side effects. Assignment is something
that is done in mathematics, of course (it is frequently necessary to
say what the symbols mean), but not in formulae or equations. The
array operator is C's equivalent of subscript notation, whilst logical
and discontinuous ops have a sort of semi-mathematical status (if a
formuala has an "if" in it it's said not to be a deterministic
mathematical method, however you'll frequently see ifs in equations in
scientific literature).
 
S

Seebs

A function is any mapping of a set of input parameters to output
parameters. So in fact all the C operators are functions because they
all yield values.

Pedantry time!

There is a single exception. See, casting is considered an operator in C:
cast-expression:
unary-expression
( type-name ) cast-expression

In the event that "type-name" is "void", this is an operator which does
not yield a value.

Thank you, thank you. I'll be here all week. Remember to tip your
servers*.

-s
[*] I figure an irrelevant moment of pedantry like that ought to be a
stage show.
 
R

Richard Bos

Rob Kendrick said:
All three! :)

No, it's implementation-defined. Either the in-house phone system
defined the meaning of "0", or it does not, in which case the phone
network still does.
There _may_ be networks which do not define initial "0" as either having
some special meaning or being just another digit, in which case it would
be unspecified, but I doubt it.
It's certainly not undefined; I don't think international telephony
treaties allow for phones to explode on mere user dialing.

Richard
 
R

Rob Kendrick

On Fri, 30 Apr 2010 20:40:39 GMT
It's certainly not undefined; I don't think international telephony
treaties allow for phones to explode on mere user dialing.

Which specification forbids this? :)

B.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Turbo C 4
Turbo C 5
String in Turbo C 2
Turbo C 1
Turbo C 3
Inserting data in a saved file 4
Turbo C 1
Series programme in Turbo C 0

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,128
Latest member
ElwoodPhil
Top