473,394 Members | 1,663 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,394 software developers and data experts.

what is the value of int c if int c= --2

Guys help me in this problem , I've tried so many times but didn't reached to any point so please bring this easy to me
Jun 8 '15 #1
3 1350
donbock
2,426 Expert 2GB
Where did you run across this?
Does your compiler emit any errors or warnings for this line?
What version of C are you using?
Jun 8 '15 #2
imrans
1
lvalue error for --2.
Jun 10 '15 #3
donbock
2,426 Expert 2GB
Where did you run across this?

Once upon a time, the compound assignments were specified as =+ and =-. This form was described as obsolete in 1978, so we're talking about ancient history. If you encountered this construction in 40-year-old C code then maybe the intended functionality was equivalent to:
Expand|Select|Wrap|Line Numbers
  1. c -= -2;
If you encountered this construction in more recent code then it is merely a mistake.
Jun 10 '15 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

15
by: Greenhorn | last post by:
Hi, when a function doesn't specify a return type ,value what value is returned. In the below programme, the function sample()is returning the value passed to 'k'. sample(int); main() { int...
4
by: hari | last post by:
I am trying to enter the results of a checkbox into an MS SQL table.The checkbox returns a bool value that I want to place in the database as a bit. Or is there a better method? I need to read...
4
by: Jimbo1873 | last post by:
Hi can someone help me with these problems. 1. what value is assigned to the type 'double' variable 'x' by the statement x = 25.0 * / 2.5; 2. what value is assigned to 'x' by the following...
3
by: Middletree | last post by:
At first glance, the question in the subject line seems way too easy. But I am finding some situations in my app where the value in a variable is some sort of blank-like value, such as Null or...
50
by: LaundroMat | last post by:
Suppose I have this function: def f(var=1): return var*2 What value do I have to pass to f() if I want it to evaluate var to 1? I know that f() will return 2, but what if I absolutely want to...
1
by: dinesh123 | last post by:
int main() { int d = 5; int m = 10; int y = 4055; int c = 0; int val; val = ( d + m + y + (y/4) + c) % 7; cout << val; return 0; }
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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
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...

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.