Virtual function not overloading in derived class class CommandRoot { protected:     string cmdString = "";     string title = "";     string tags = "";     string description = "";  public:     string getCmdString() {         return cmdString;     }     string getTitle() {         return title;     }     string getTags() {         return tags;     }     string getDescription() {         return description;     }      virtual bool onTrigger() {         return 1;     } };  class CmdFirst : public CommandRoot{     public:     CmdFirst() {         cmdString = "testing1";         title = "";         tags = "";         description = "";     }      bool onTrigger() {         cout &lt;&lt; "C";         return 0;     } };  class Player {     NPC *target = NULL;     CommandRoot *cmdList[1];  public:     Player() {         cmdList[0] = new CmdFirst();     }      CommandRoot getCmdList(int n) {         return *cmdList[n];     }      NPC getTarget() {         return *target;     }      bool setTarget(NPC* t) {         target = t;         return 0;     }      string listen() {         string cmd = "";         cin &gt;&gt; cmd;         return cmd;     } };  int main() {     std::cout &lt;&lt; "Hello World!\n";      Player* player = new Player();     NPC* firstNPC = new NPC();     player-&gt;setTarget(firstNPC);      bool exit = false;     do {         if (player-&gt;listen().compare(player-&gt;getCmdList(0).getCmdString()) == 0) {             cout &lt;&lt; "A";             cout &lt;&lt; player-&gt;getCmdList(0).onTrigger();         }         else         {             cout &lt;&lt; "B";         }     } while (exit == false); }   The following line is calling the parent's virtual function instead of the derived class.  cout &lt;&lt; player-&gt;getCmdList(0).onTrigger();   I have a feeling it's because the data type of the array is the parent class, but that shouldn't prevent the array element from being assigned the data type of the derived class, then calling that class's function.
What is object slicing? Someone mentioned it in the IRC as the slicing problem.
How can I check if a word is contained in another string using PHP? Add leading zeroes to number in Java? An elementary proof of $\int_{0}^{1}\frac{\arctan x}{\sqrt{x(1-x^2)}}\,dx = \frac{1}{32}\sqrt{2\pi}\,\Gamma\left(\tfrac{1}{4}\right)^2$ How to verify iOS app integrity? If I write an app for iOS and it's accepted by the AppStore, how do I know if the app is actually the app I compiled and has not being substituted/altered by, say, a "Man in the middle" style interception/attack? Is there a way to do a checksum either after the fact or from inside the app itself? I was having a look at an old question of mine when I browsed the  from the timeline. I scrolled downwards and realized the Review completed panel comes along for the ride. While that might be , tags flowing over top of it as pictured below probably isn't.  Here's a .gif of the Question and Duplicate tabs flowing over it as well. Note that the timeline button also flows over. If vote buttons are present, they will also flow over it.  Reproduced on Chrome and Microsoft Edge. Update Per  by Tiago Martins Peres, this issue also happens in other Review types, namely Late Answers, First Posts and Low Quality Posts. In addition to that, it is causing the action buttons on reviews to become unclickable if you scroll low enough.  As a temporary workaround, you can use 's , which  this issue. I refer to the usage of "don't" as an imperative to tell someone what not to do. As in,     Hey! Don't you dare touch that button!   When it is used in the interrogative or as part of a statement, "don't" can be expanded like most other contractions. It either just breaks up right in the sentence, or surrounds the subject.     Don't you love me, Juanromeo? -> Do you not love me, Juanromeo?      I don't love you, Marijuliet. -> I do not love you, Marijuliet.   However, I have no idea how one breaks up the imperative. "Do you not dare[...]" sounds like it's a lead up to a question, "You do not dare[...]" comes across as a statement moreso than a command, and "Do not you dare[...]" just sounds silly.  "Don't" is a bit unique among "not" contractions (at least that I know of) because it is the only one that can be used in an imperative sense. Couldn't, shouldn't, wouldn't, haven't, isn't, doesn't, aren't, can't... none of these can be used in an imperative sense because you cannot command someone to could, should, etc.  Is it possible to expand the don't contraction when it is used as part of a command? Or is its unique case such that it exists as its own linguistic construct? What do you call somebody who asks a question and somebody who answers a question? What do you call somebody who asks a question and somebody who answers a question?  I have exhausted the thesaurus with no real luck... any ideas?  EDIT: It is in reference to this - or any other StackExchange - site in which the question is posed by X and answer is submitted by Y.    EDIT 2: In the context of StackExchange, and the fact I need plurality (something I neglected to mention oooops), I have decided upon "Posters" and "Respondents"... Why screen resolution remains 640x480 when I close a game? Show $\text{Hom}_{Ab}(A,\mathbb{Q}) = \{0\}$ for finite $A$ In unix/linux, any number of consecutive forwardslashes in a path is generally equivalent to a single forwardslash. eg.  $ cd /home/shum $ pwd /home/shum $ cd /home//shum $ pwd /home/shum $ cd /home///shum $ pwd /home/shum   Yet for some reason two forwardslashes at the beginning of an absolute path is treated specially. eg.  $ cd ////home $ pwd /home $ cd /// $ pwd / $ cd // $ pwd // $ cd home//shum $ pwd //home/shum   Any other number of consecutive forwardslashes anywhere else in a patch gets truncated, but two at the beginning will remain, even if you then navigate around the filesystem relative to it.  Why is this? Is there any difference between /... and //... ? Which graphics cards are supported by the new AMDGPU driver in Ubuntu 16.04? Does casting blindness on a Medusa (or other gaze using creature) stop their gaze attack? How to use 'hover' in CSS Windows 7 stuck on CLASSPNP.SYS I'm running Win 7 x86 on a Lenovo Thinkpad Z61m in dual boot mode with Win XP, both OSes are running on separate partitions. I have a faulty battery and if left unplugged my laptop shuts usually down within 10 minutes. Last night, it shut down due to this, but after plugging in AC power and starting back up I'm stuck at the "Starting Windows" screen, I'm unable to boot into safe mode or into recovery mode(XP boots fine).  I believe I had installed some Win 7 updates the same/previous day. From one of the boot options I was able to see that Windows 7 is getting stuck on CLASSPNP.SYS  How can I go about fixing this?  I do have a complete Win 7 Restore CD that I created after setting up my machine, I'm unable to boot into this either.  Please help! If I have two variables:  Object obj; String methodName = "getName";   Without knowing the class of obj, how can I call the method identified by methodName on it?  The method being called has no parameters, and a String return value. It's a getter for a Java bean. What is the difference between AOSP and AOKP? So  i have a scene with a few objects, and a water simulation in the scene. However I want to animate the camera turning around in the scene, while the water simulation is frozen in time. So something like a time freeze effect. But when ever I try to render an animation it renders the water simulation too. I just need one frame of the water simulation. Is there a way to do this? Can I, as a reviewer, tell authors to get a native English speaker to proofread their paper? I am reviewing a paper for possible publication in a respected journal. The English in the paper is very poor. The authors are clearly not native English speakers. I want to write something to the effect of the following in my review.   I advise the authors to find a native English speaker to proofread the manuscript.    My question: Is this appropriate in a review?  On one hand, I think it is good, constructive advice. The paper would be significantly clearer if someone spent a few hours helping them fix it up. I can try to help them through reviewer comments, but it would be much easier if someone could help them in person. The authors are located in a western English-speaking country, so they should be able to find someone.  On the other hand, I don't want to be "the mean reviewer." I understand that English can be difficult to master for immigrants. Perhaps there is a more diplomatic way of saying this. Seeking English term for relationship between two members of extended family? Here at the Genealogy and Family History Stack Exchange we see many questions about relationship mapping which is also known as:   relationship calculation kinship terminology etc   If you are just trying to understand how to calculate "cousins and removes" then  provides an excellent guide.  However, if you are seeking an English term for a more complicated relationship between two members of an extended family, rather than asking a question like:          site users are encouraged to first review the answers below.    Note: This Q&amp;A arises from  and is set to  to help make it canonical. Avoid trailing zeroes in printf() I keep stumbling on the format specifiers for the printf() family of functions.  What I want is to be able to print a double (or float) with a maximum given number of digits after the decimal point.  If I use:  printf("%1.3f", 359.01335); printf("%1.3f", 359.00999);   I get  359.013 359.010   Instead of the desired  359.013 359.01   Can anybody help me?