#include &lt;stdio.h&gt;      int main()     {         int x = 0;          if (x++)             printf("true\n");         else if (x == 1)             printf("false\n");         return 0;     }   Output:  false   Why is the output false?  x++ is post increment; this means that the value of x is used then it is incremented. If it is so, then x=0 should be used and the answer should be true.
Possible Duplicate:          Here is a test case:   void foo(int i, int j) {    printf("%d %d", i, j); } ... test = 0; foo(test++, test);   I would expect to get a "0 1" output, but I get "0 0"  What gives??
To my understanding, this is the default configuration of /etc/crontab:  # m h dom mon dow user  command 17 *    * * *   root    cd / &amp;&amp; run-parts --report /etc/cron.hourly 25 6    * * *   root    test -x /usr/sbin/anacron || ( cd / &amp;&amp; run-parts --report /etc/cron.daily ) 47 6    * * 7   root    test -x /usr/sbin/anacron || ( cd / &amp;&amp; run-parts --report /etc/cron.weekly ) 52 6    1 * *   root    test -x /usr/sbin/anacron || ( cd / &amp;&amp; run-parts --report /etc/cron.monthly )   Why were these specific times chosen for the default entries?  At first I assumed that they are somewhat randomized on installation to even out the system load, but that doesn't seem to be correct. To post an image in a question/answer an user requires at least 10 rep points (see ). To be able to upload an image in the chat, the rep requirements is instead 100 rep point (see ).  Is there any reason to that? I am asking because IF the rationale is to provide more protection inside the chat, the protection is easily circumvented by uploading the image via the question editor, and then copying the link to the chat. Basically, the more restrictive requirement fail to reach its goal - assuming that blocking uploads from new users was indeed the target.  I am not proposing to change that (it doesn't seem worthy the effort) but I was curios to know if this is just a refuse caused by successive changes to the system or if there is actually a different rationale to this that I am missing.  [note: I will remove the double Discussion/Support tag as soon as I can focus if the question has a staff answer - support or will prompt a discussion] Using sObject.get() to fetch a field value from a related parent object I have a contact in a generic sObject in apex and while I'm able to easily get detail field values using   sObject.get('MyContactField__c')  I'm not able to get fields off the related parent object, and I'm sure the related field is in memory, based on the debug logs. This returns a runtime error:  sObject.get('Account.MyAccountField__c')  with the error     Invalid field Account.MyAccountField__c' for Contact   How do I get a field value off of a parent on a generic sObject? Prove the map sending a matrix to it's inverse is continuous. Do I need Intel Smart Response when installing Ubuntu? I plan to attach my 2014 and 2015 annual leave letters to prove I was on leave, and a letter from my sales manager who was in charge of the business during my vacation.  I intend to explain all my sources of income in additional letter because the ECO calculations of my income were different from mine.   How else can I improve my new application? script to count files in a directory My laptop running Windows 7 Ultimate (non OEM) died on me today and it has tonnes of stuff on it - my projects, Visual Studio and office installations, etc. etc.  I am getting a new laptop from somewhere and was wondering if I could just unplug the hard disk from my original (dead) machine and plug it into the new one.  I remember trying this once with Windows Xp (on a desktop) and the OS crashed on boot and I had to reinstall everything again.  I have read about  but by the looks of it, it can be used only when the host computer is alive and kicking -- which mine isn't.  My old laptop was a Compaq Pressario v3000 (3 years old) on an AMD and the new one is going to be a new dual core Intel HP laptop.  Any ideas?  Thanks! Meaning of Sun Lamp Size? How to overlay images I want to overlay one image with another using CSS. An example of this is the first image (the background if you like) will be a thumbnail link of a product, with the link opening a lightbox / popup showing a larger version of the image.   On top of this linked image I would like an image of a magnifying glass, to show people that the image can be clicked to enlarge it (apparently this isn't obvious without the magnifying glass). How do you kill a java.lang.Thread in Java? Showing that ${\rm E}[X]=\sum_{k=0}^\infty P(X>k)$ for a discrete random variable Let $X$ be a discrete random variable whose range is $0,1,2,3,\ldots$. Prove that $$ {\rm E}[X]=\sum_{k=0}^\infty P(X&gt;k). $$  How to prove this? I tried a bit but unable to post due to formatting issue. Can anyone help? What to do when visa admission expires during lockdown? I was admitted to the US as a visitor for a period which expires soon.  Until tonight, I had solid plans to return to Europe soon, prior to the expiration of the visa entry, but that is no longer an option.  I do not wish to overstay or do anything that would cause problems with future admissions or visa applications.  However, I can't go back to Europe because of new travel restrictions put in place by the US government (/resulting flight cancellations).    My passport still has years of validity left.  What is the best course of action? Is there any official guidance on this subject?  I am a little concerned that contacting officials to explain the situation would just lead me to be flagged for prompt enforcement action, but I don't want future problems.    Related:  and .    Update: OP now planning an escape to Canada.  The question still stands, though. Change Folder Permissions How to prove $\gcd(a^2,b^2) = (\gcd(a,b))^2$? How to prove $\gcd(a^2, b^2) = (\gcd(a, b))^2$?  My attempt:  Let $\gcd(a, b) = d$.  Then $d|a$ and $d|b$ then $d^2|a^2$ and $d^2|b^2$. i.e $d^2$ divides $a^2 ~~\&amp;~~ b^2$. Why is 3D stress tensor acting only on three surfaces? I'm trying to learn about the stress tensor (in 3D)    The tensors are said to have directions (the first subindex $i$ in $\sigma_{ij}$) and specify the surface upon which they act (the second subindex $j$ in $\sigma_{ij}$).  What confuses me is why is it defined only to act on three surfaces, even when the cube has six surfaces? Don't invite people when moving their messages Prove $\mathbb{P}(\sup_{t \geq 0} M_t > x \mid \mathcal{F}_0)= 1 \wedge \frac{M_0}{x}$ for a martingale $(M_t)_{t \geq 0}$ Let $M$ be a positive, continuous martingale that converges a.s. to zero as $t$ tends to infinity. I now want to prove that for every $x&gt;0$ $$ P\left( \sup_{t \geq 0 } M_t &gt; x \mid \mathcal{F}_0 \right) = 1 \wedge \frac{M_0}{x}. $$ My approach: I thought that rewriting the conditional probability to an expectation would help so we obtain that we must prove: $$ \mathbb{E} \left[ 1_{\sup_{t \geq 0 } M_t &gt; x}  \mid \mathcal{F}_0 \right] = 1 \wedge \frac{M_0}{x}.$$ A hint to me was given that I should consider stopping the process when it gets above $x$. Thus a stopping time that would do this is $\tau = \inf\{t\geq 0 : M_t&gt;x\}$. But now I'm stuck as I want to apply optional sampling results but we have an indicator which complicates things. How could I proceed from this? Any help is appreciated! Beamer - Color of header foreground with AnnArbor theme I use beamer with the theme AnnArbor and colortheme whale.  I tried to use:  \setbeamercolor{section in head/foot}{fg=white, bg=blue}   or  \setbeamercolor{palette tertiary}{fg=white, bg=blue}   But for an unknown reason, the bg works but not the fg... The sections names stay black in the header.    EDIT : the problem comes from the hyperref package.  This code works well :  \documentclass{beamer} \usetheme{AnnArbor} \usecolortheme{whale} \setbeamercolor{frametitle}{fg=white,bg=blue}  \begin{document}     \section{Test 1}     \subsection{Test 1.1}     \begin{frame}         \frametitle{Test}     \end{frame} \end{document}   Whereas this one doesn't works :  \documentclass{beamer} \usetheme{AnnArbor} \usecolortheme{whale} \setbeamercolor{frametitle}{fg=white,bg=blue} \usepackage{hyperref} \hypersetup{     colorlinks=true,     linkcolor=black,     urlcolor=blue,     citecolor=gray,     frenchlinks=false,     pdfborder={0 0 0} }  \begin{document}     \section{Test 1}     \subsection{Test 1.1}     \begin{frame}         \frametitle{Test}     \end{frame} \end{document}   And that's pretty normal because of this line :  linkcolor=black, How to handle users who don't select answers for their questions?