look at these two conditions in the code and output respectively: #include &lt;iostream&gt; using namespace std;  int main() {     int i=1;     i=i++;  // first condition      i++; //2nd condition      cout &lt;&lt; i &lt;&lt; endl; //it will print 2 in second condition **but why print 1 in first condition?**       return 0; }
In C, what is the difference between using ++i and i++, and which should be used in the incrementation block of a for loop?
Say a prospective PhD has a high reply rate (90-95%) to first contact emails with potential superviors. He/She has a well thought out e-mail, but a particular professor (here: USA) that is in the top preferences does not reply after two to three e-mails that were sent within a time frame of three months. I also followed the instructions on the professor personal website in the section "prospective PhD students". The student has already contacted some of the advisor students and has received positive feedback about the professor.  Should the student just give up and move on? Should the student keep trying?  Aside from the obvious "I have too many incoming e-mails to answer" or "I am out in the field", what could create a no response behavior from the professor?  I have seen the simplistic answer "move on, bad advisor, doesn't have time, etc". But this seems a contradiction in this case. The PhD students like the professor and say he/she is personable and no e-mail response after a few well written emails. Easy is to beginner as medium is to I want to display three levels in my game...but I don't know what the text should say.  easy -&gt; Beginner  medium -&gt; ?  hard -&gt; Expert   Basically, I want the form that describes the person playing the game, instead of the game itself. What adjective is best?  I have considered adept.  I doubt my users will know what adept means. Also, I need something in between expert and beginner. Adept falls into the expert category. Is there anything more common that I can use, that has the same impact as the other two words I mentioned?  Proficient would work, theoretically, but in day-to-day term, the levels "beginner - proficient - expert" won't sound great. Change footer in beginning of chapters I want the footer of all pages to be "Page N°X" on the right. I used this:  \usepackage{fancyhdr} \pagestyle{fancy} \fancyhf{} % clear all header and footer fields \fancyhead[R]{\leftmark} \fancyfoot[R]{\footnotesize Página N$^\circ$ \thepage\ } \renewcommand{\headrulewidth}{0pt} \renewcommand{\footrulewidth}{0pt}   It works on every page but the chapter beginning ones. What are uses of the C++ construct "placement new"? Possible Duplicate:          I was wondering if there's any good reason to still use blob fields in a database. A couple of years ago I worked with a DB with a bunch of images in it, the DB was very slow and I couldn't see any good reason to keep the images inside the DB, so I got the images out and stored the filenames instead.  Was this a smart move? What would you do in my place? Why didn't the Emperor realize that torturing Luke to death in front of Vader might be a bad idea? I'm trying to use the Html.DropDownList extension method but can't figure out how to use it with an enumeration.  Let's say I have an enumeration like this:  public enum ItemTypes {     Movie = 1,     Game = 2,     Book = 3 }   How do I go about creating a dropdown with these values using the Html.DropDownList extension method?  Or is my best bet to simply create a for loop and create the Html elements manually? Travel duration from Earth to a star at 9.8 m/s² acceleration Why was the switch statement designed to need a break? Given a simple switch statement  switch (int) {     case 1 :     {         printf("1\n");         break;     }      case 2 :      {         printf("2\n");     }      case 3 :      {         printf("3\n");     } }   The absence of a break statement in case 2, implies that execution will continue inside the code for case 3. This is not an accident; it was designed that way. Why was this decisions made? What benefit does this provide vs. having an automatic break semantic for the blocks? What was the rationale? How to understand the notion of a differential of a function How to efficiently animate 2D scene spanning sprites in Unity? Our game is a 2D point-and-click adventure game.  One of the levels is set in a factory with conveyor belts that span the scene.  The game is hand animated in 2D and so animating these conveyor belts could potentially take up lots of memory since the sprites are as long as the screen (it's an HD game - 1920 x 1080). I'm not sure if tiled sprite shapes can be animated, so I was wondering if there's a prescribed way to handle larger sprite animation like this - efficiently. How to list all nodes of nodetype A which has the current node referenced? So this is what I'm trying to do in Drupal 6:  Node type A is video, node type B is a person Nodetype A has a reference field where you can enter a reference to any Node from nodetype B  how can I create a block view which will be displayed on nodes from node type b, which will show all the nodes from node type A where the current node from node type B is referenced? Why have header files and .cpp files? Why does C++ have header files and .cpp files? Check if email exist php Prevent specific sites from being overrepresented in the hot questions list Some sites appear far more often in the hot questions list than other sites. I don't have any hard data on that, as that kind of data is just not publicly available, but I'm pretty sure my subjective impression on that is reasonably accurate.  Those sites don't appear more often because they are inherently more interesting, but because they have certain voting and answering patterns that favor them in the hot questions algorithm. I would argue that the goal of the hot questions list is to present questions from a large variety of SE sites to the whole network, and to show possibly interesting questions to users that would not have found them otherwise.   To achieve this goal, the spots in the hot questions list should be distributed among all SE sites. The algorithm should try to get a good sampling of all sites, and it should try to normalize the results for varying voting behaviour. At the moment, sites that intrinsically get more votes and more answers per question seem favored in the algorithm.  So I think one part of the algorithm should try to identify questions that get an unusally high amount of votes and views for that site, and give the smaller sites a chance this way.  I'm not sure on how exactly this weighting should be done, as a complete normalization would likely not work across the huge difference in scale for all the SE sites.  As a specific example that the current algorithm is broken I'll present . I don't think any site should occupy a third of the whole list.   Here's another instance where one site is overrepresented at the top of the list: The sign in the formula for the voltage across the inductor This question is about voltage induced in a inductance.  I know the rate of change of current induces EMF in the inductor. The direction of the induced EMF will be opposite to the change that is causing it. The EMF induced is given by the following formula.  $$V_l = -L \frac{dI}{dt}$$  The negative sign indicates direction of induced emf across the coil is opposite the current change.     In the picture I have drawn current direction and \$V_l\$ direction.  If \$\dfrac{dI}{dt}\$ is postive, \$V_l\$ will be negative according to formula right? Or does the direction of \$V_l\$ has to be reversed?  In many Internet references I found \$V_l = L \dfrac{dI}{dt}\$. Which one is correct?  I hope they reversed \$V_l\$ reference points and removed the negative sign in the formula. Please clarify. Why do students go for a PhD even when chances of getting academic jobs on its completion are slim? This is in reference to my question: .  I was told in the answer of the above linked question that chances of landing a job as an assistant professor in Mathematics are quite slim. Very few people will actually get a permanent position in academia.  An article of 2014 shows only 0.5-3% of PhD graduates will actually get a job as an Assistant Professor.  But I have two questions:        Why do so many people still apply for a PhD in some reputed institutes in India even knowing the harsh reality? I found there are 1500 applications for four PhD scholarship positions.          One answer says that people move to industry, but I still don’t understand how after doing a PhD in suppose differential geometry or algebraic geometry one can do a job in industry if he/she gets no position as an assistant professor.   Will one be satisfied to do some managerial work in some Consultancy firm after doing a PhD in Mathematics?      Are people jobless after a PhD?   Completion of a PhD requires so much effort. So why is there no value after doing it?      NOTE:  In the most up-voted answer below it has been said that many who enroll for  a PhD don't even wish to pursue an academic career.  I have been asking my seniors who are currently pursuing a PhD or are in the verge of completing their degree or who have completed it. They said that they all want to be Professors in some Universities and want to be involved in research because that is the dream job for them.  I am obviously talking about PhD in Mathematics How to prove $|a+b|^k \leq 2^{k-1} (|a|^k+|b|^k)$? Assume that you have any two real numbers $a$ and $b$, and $1\leq k &lt;\infty$, $k \in \mathbb{R}$.  How would you prove the inequality $|a+b|^k \leq 2^{k-1} (|a|^k+|b|^k)$? Is it possible to add a list of hosts that are only specific to a certain user? Perhaps a user-specific hosts file?  This mechanism should also complement the entries in the /etc/hosts file. Number of onto functions