From: "Joel M. Pareja" <jpareja@infoweapons.com>
To: linux-c-programming@vger.kernel.org
Subject: Re: Significance of using + before function calls.
Date: Wed, 15 Mar 2006 16:16:59 +0800 [thread overview]
Message-ID: <4417CD7B.4050909@infoweapons.com> (raw)
In-Reply-To: <44181931.8000507@wipro.com>
[-- Attachment #1: Type: text/plain, Size: 1422 bytes --]
That must be a typographical error.
Because '+' does nothing to the return value of the function.
Also because there is no lvalue in the expression.
But with '-', there is an effect.
int dummy_func() { return 5; }
int num = -dummy_func();
As a result, num will be '-5'.
Vamsi wrote:
>
> Joel M. Pareja wrote:
>
>> The placement of '+' or '-' before the function call is performing a
>> unary operator on the return value of the function.
>
> does it server any purpose ? , unary '+' operator will not have any
> significance effect on the return value
>
> -Vamsi
>
>>
>> Vamsi wrote:
>>
>>> Hi List,
>>>
>>> i have seen a code snippet which starts with + symbol,
>>>
>>> +system("ls -l");
>>>
>>> what is the significance of using + symbol before system.
>>>
>>> i also tried using + before printf ,, like +printf("Some text"); and
>>> it is compiling and working tooo,,
>>>
>>> Can somebody clarify wht does that + signify??
>>>
>>> Thank You.
>>>
>>> -Vamsi
>>>
>>> -
>>> To unsubscribe from this list: send the line "unsubscribe
>>> linux-c-programming" in
>>> the body of a message to majordomo@vger.kernel.org
>>> More majordomo info at http://vger.kernel.org/majordomo-info.html
>>
>
> -
> To unsubscribe from this list: send the line "unsubscribe
> linux-c-programming" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/x-pkcs7-signature, Size: 3178 bytes --]
next prev parent reply other threads:[~2006-03-15 8:16 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-03-15 12:59 Significance of using + before function calls Vamsi
2006-03-15 7:51 ` Steve Graegert
2006-03-15 7:58 ` Per Jessen
2006-03-15 12:11 ` Steve Graegert
2006-03-15 7:59 ` Joel M. Pareja
2006-03-15 13:40 ` Vamsi
2006-03-15 8:16 ` Joel M. Pareja [this message]
2006-03-15 10:09 ` Glynn Clements
2006-03-15 15:48 ` Vamsi
2006-03-15 20:34 ` Tomas Janousek
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4417CD7B.4050909@infoweapons.com \
--to=jpareja@infoweapons.com \
--cc=linux-c-programming@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.