|
See C++ Operator Precedence - cppreference.com[^].
The first step is inserting parentheses according to the predence and order:
z = (x++) - (((--y) * b) / a);
Then replace the variables with their values:
z = (5++) - (((--(-10)) * 2) / 4);
Now solve step by step but observe the special handling of the postfix operator which will return a temporary copy that contains the value before the operation (that means x will be changed but the initial value of 5 is used for the calculation). Observe also that results might get rounded wirh integer arithmetic:
z = (5) - ((-11 * 2) / 4);
z = 5 - (-22 / 4);
|
|
|
|
|
parkavikkk wrote: int z, x=5, y= -10, a=4, b=2;
z=x++ - --y *b/a;
Can anyone please solve it and explain the precedence. i am not getting right answer. my answer is 2.5. but it is wrong.
Of course it is wrong! Just because the integer number cannot be 2.5, nor 2.7, nor 2.8...
|
|
|
|
|
Maybe the OP was manually calculating it?
|
|
|
|
|
hi, I recently come accross pla.h
what's the purpose of it ?
|
|
|
|
|
I guessing it has to do with declarations associated with Windows performance logs and alerts [^].
"the debugger doesn't tell me anything because this code compiles just fine" - random QA comment
"Facebook is where you tell lies to your friends. Twitter is where you tell the truth to strangers." - chriselst
"I don't drink any more... then again, I don't drink any less." - Mike Mullikins uncle
|
|
|
|
|
It's a header file. Open it up to reveal its contents. If things are named appropriately and/or it's commented well, you should be able to ascertain its purpose.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
I checked it before I ask this question....
anyways thank you for the answer...
I already got the answer from stackoverflow but my question got block...
so I wonder how this forum will react
|
|
|
|
|
(not really urgent)
I decided to try out the C++ Core Check code analysis on a sample project to see if it will be useful for our project.
One one line it says that I need to put a const , so I put the const , and re-run the analysis.
The line still will trigger the warning.
Any way to reset the warnings so that it won't retrigger the same warnings ?
Any experience with that ?
Thanks
I'd rather be phishing!
|
|
|
|
|
If you right-click the warning do you get a menu with Suppress on it?
|
|
|
|
|
I don't want to suppress the warning, just to not report it on lines that it should not appears (after fixing the warning).
Anyway, it is only a minor annoyance, will keep testing/using it .
Thanks.
I'd rather be phishing!
|
|
|
|
|
As I say, if you right-click the warning you can suppress it for that line, not suppress the warning for every line.
|
|
|
|
|
Yes but he's saying that he did what the warning wanted and the warning keeps coming up anyway on that line.
He's asking for a way to make it work right.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
"Any way to reset the warnings so that it won't retrigger the same warnings ?"
|
|
|
|
|
Hi All,
I have a C++ application which reads access (.mdb) file. This application runs fine on Windows XP,7 OS. But when I run the application on Embedded Standard OS, it gives me System Error 126 (Microsoft Access Driver).
What would be the best solution for this?
Kindly help in solving this problem.
Thanks In advance
|
|
|
|
|
That usually indicates a missing or mis-configured driver. You need to check that the Access driver is correctly installed.
|
|
|
|
|
Hello
Thanks for taking time to answer.
Now I've installed MS-office and Access database Engine 2010 drive also. Bit still the application is giving same error.
The OS is Windows Embedded Standard 2009, service pack 3.
Is there any other way to solve this problem? Like by using different driver from code instead of Microsoft Access Driver (*mdb)?
|
|
|
|
|
The error code alone is not enough. You need to find out where and why the error is being raised.
|
|
|
|
|
The error is occurring when access database is tried to open.
As you said in the previous reply, missing of driver, Can the driver be installed explicitly by using any tool?
The problem here is I'm not having the CD of OS using which I could have reinstalled the missing driver.
can you suggest any other way to fix it
|
|
|
|
|
Sorry but I have never used it in embedded. You will need to use the debugger, or similar tool, to gather more information. Have you tried Google to see if other people have come across the same problem?
|
|
|
|
|
Ya I searched. everywhere they are suggesting to install the driver using installation CD which currently I'm not able to as I do not have a CD..
|
|
|
|
|
Embedded 2009 is an XP OS, with bits added, and taken away....
And thats probably the issue. Its a PITA finding out what was ripped out, I have see all kinds of crap with this version, it takes a lot of detective work to figure out quite how MSFT broke it.
|
|
|
|
|
Any solution that you could suggest in finding the exact problem and getting it solved?
|
|
|
|
|
google the issue, ask on msft forums, try to work out which compmonent is throwing the error. Get a working XP system and compare it to the embedded 2009 one, look for files, registry settings that are differemt.
Its a PITA, like I said.
|
|
|
|
|
Munchies_Matt wrote: I have see all kinds of crap with this version, it takes a lot of detective work to figure out quite how MSFT broke it.
Care to elaborate? Microsoft did not distribute prebuilt embedded OS images for that version. The embedded OS is built by you or someone in your organization using the 'Target Designer' which allows you to select from many thousands of packages.
If anything is broken... blame the guy who builds the OS image within your organization. The license back then was very restrictive... requiring each organization to list the licensed users by name.
I've built hundreds and hundreds of embedded OS images with the old XP and 2009 Target Designer... I believe the licensing is less restrictive these days... but I don't work in this area anymore so don't keep up with it.
Best Wishes,
-David Delaune
|
|
|
|
|
divya03 wrote:
Now I've installed MS-office and Access database Engine 2010 drive also. Is it newer than the version offered here?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|