473,398 Members | 2,113 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

"evaluate parameter more than once"

Friends,
I come across a resent thread describes the differences between
getc() vs fgetc().
There some body stated the sentence "evaluate its parameter more than
once".
I cannot understand the word ‘evaluate' in the message. The poster
also gives a
Example for the sentence, which is hard for me to understand. I
searched the FAQ
and I think I have missed it. The thread's link is:
http://groups.google.com/groups?hl=e...c2c8e1d&rnum=1
Thanks
Nov 14 '05 #1
2 1379
da***********@yahoo.com wrote:

Friends,
I come across a resent thread describes the differences between
getc() vs fgetc().
There some body stated the sentence
"evaluate its parameter more than once".
I cannot understand the word ‘evaluate' in the message.


The sizeof operator does *not* evaluate it's operand.
The printf function *does* evaluate it's arguments.

If you have
char x = 0;
and then also
printf("%u, ", (unsigned)sizeof ++x); /* x is not incremented */
printf("%d, ", x); /* x is not incremented */
printf("%d\n", ++x); /* x is incremented */
.... then the output will be:
1, 0, 1

--
pete
Nov 14 '05 #2
pete <pf*****@mindspring.com> wrote in message news:<40***********@mindspring.com>...
da***********@yahoo.com wrote:

Friends,
I come across a resent thread describes the differences between
getc() vs fgetc().
There some body stated the sentence
"evaluate its parameter more than once".
I cannot understand the word ?evaluate' in the message.


The sizeof operator does *not* evaluate it's operand.
The printf function *does* evaluate it's arguments.

If you have
char x = 0;
and then also
printf("%u, ", (unsigned)sizeof ++x); /* x is not incremented */
printf("%d, ", x); /* x is not incremented */
printf("%d\n", ++x); /* x is incremented */
... then the output will be:
1, 0, 1

To whatever value (within SCHAR_MAX and MIN)'x' initialized to - the
first printf always prints *1*

- Ravi
Nov 14 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Mysooru | last post by:
Hi All, One of the ATL class..... template <class Base> class CComObject : public Base { public: typedef Base _BaseClass;
11
by: Florian Loitsch | last post by:
I'm currently writing a JS->Scheme compiler (which, using Bigloo, automatically yields a JS->C, JS->JVM, JS->.NET compiler), and have a question concerning the function-parameters: According to...
2
by: John A Grandy | last post by:
Is there something special in XML about the name "Parameter" ... I am not able to XPATH query for nodes named "Parameter" <Root> <Category CategoryID="1"> <Elements> <Element...
3
by: Jason luo | last post by:
Hi all, In c99-standard page 52,there is a sentence about void,as below: If an expression of any other type is evaluated as a void expression, its value or designator is discarded. I don't...
40
by: Dave Hansen | last post by:
Please note crosspost. Often when writing code requiring function pointers, it is necessary to write functions that ignore their formal parameters. For example, a state machine function might...
4
by: Ondrej Spanel | last post by:
The code below does not compile with .NET 2003, I get folowing error: w:\c\Pokusy\delegTemplArg\delegTemplArg.cpp(11) : error C2993: 'float' : illegal type for non-type template parameter 'x' ...
0
by: Michael | last post by:
Hi. I am building asp page. One of the <tdcoomponents should include text field from database which is include whole HTML page taken once from another web site. And ofcause this text consist of...
4
by: =?utf-8?B?Qm9yaXMgRHXFoWVr?= | last post by:
Hello, what is the use-case of parameter "start" in string's "endswith" method? Consider the following minimal example: a = "testing" suffix="ing" a.endswith(suffix, 2) Significance of...
11
by: John Nagle | last post by:
I passed a dict for the "env" variable to Popen with Unicode strings for the dictionary values. Got: File "D:\Python24\lib\subprocess.py", line 706, in _execute_child TypeError: environment...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.