While learning , I notice that there is no delete adj for the new list&lt;int&gt; array:   adj = new list&lt;int&gt;[V];   Will it cause a memory leak? For this question, I made a  to using delete to release the memory explicitly.   #include &lt;iostream&gt; #include &lt;list&gt; #include &lt;algorithm&gt;  using namespace std;  int main() {     list&lt;int&gt; *adj = new list&lt;int&gt;[3];     cout &lt;&lt; adj-&gt;size() &lt;&lt; endl;      delete adj; }   delete operation will cause coredump. So why does deleting pointer to list cause core dump?  How to release the memory by new operation?
This is a question that's been nagging me for some time. I always thought that C++ should have been designed so that the delete operator (without brackets) works even with the new[] operator.  In my opinion, writing this:  int* p = new int;   should be equivalent to allocating an array of 1 element:  int* p = new int[1];   If this was true, the delete operator could always be deleting arrays, and we wouldn't need the delete[] operator.  Is there any reason why the delete[] operator was introduced in C++?  The only reason I can think of is that allocating arrays has a small memory footprint (you have to store the array size somewhere), so that distinguishing delete vs delete[] was a small memory optimization.
Can I pass arguments to an alias command? I want to know if I can pass an argument with an alias command.  for example:  alias d="dmesg|grep -iw usb|tail -5"    Now d will print the last 5 lines. If I want to use d to print a different number of lines, I have to make change in the alias command declaration of d again.  Is there any way I can modify the declaration of an alias so that I don't have to retype the declaration to change the number of lines. Like incorporating passing the number of lines as an argument while declaring alias for d? Or is there some other method to solve this? What's the simplest way to call Http GET url using Delphi? There's a web services I want to call in my application, I can use it with importing the WSDL or by just use "HTTP GET" with the URL and parameters, so I prefer the later because it's simple thing.  I know I can use indy idhttp.get, to do the job, but this is very simple thing and I don't want to add complex indy code to my application.  UPDATE: sorry if I was not clear, I meant by "not to add complex indy code", that I don't want add indy components for just this simple task, and prefer more lighter way for that. I almost always want the profile correct applied, but it's an extra step. Any ideas on how to apply these automatically? Down vote changed to up vote caused reputation meter to pass daily maximum I just experienced a minor visual bug.  I had an answer that earned 2 down votes and 22+ upvotes, earning me the daily maximum of +200. Upon making some edits to the answer at the behest of the comments, one of the users who down voted changed their vote. Now my reputation meter shows that I gained +202 for the day.    This correctly did NOT affect my reputation, as I still only gained 200, so it is merely a minor display bug.  This appears in the achievements drop down and my reputation tab on my profile. Possible Duplicate:          On Wikipedia, it says that:     Matrix representation of complex numbers   Complex numbers $z=a+ib$ can also be represented by $2\times2$ matrices that have the following form: $$\pmatrix{a&amp;-b\\b&amp;a}$$   I don't understand why they can be represented by these matrices or where these matrices come from. Everything that I have read says that iWorks/ iMovie etc should be free for Mac users after 1 September 2013.   I already bought Pages but want Numbers and iMovie. My MacBook Pro with retina is early 2015 and I am being charged.    Why is this please? What Android emulators are available? I will like to know some of the android emulators that work really well with Ubuntu 11.10 and above. I want to try 'whatsapp' on Ubuntu through an android emulator. Thanks in advance Do I need a transit visa for waiting 23 hours in Dubai airport? I am an Indian citizen living in Ukraine. I will be traveling to India but I need to wait in Dubai airport 23 hours for my next flight to India. I will not be leaving Dubai airport.  So in this case do I need a transit visa? Why does this not work with an imaginary exponent? Should I upgrade to the "mainline" kernels? In school, we just started learning about trigonometry, and I was wondering: is there a way to find the sine, cosine, tangent, cosecant, secant, and cotangent of a single angle without using a calculator?  Sometimes I don't feel right when I can't do things out myself and let a machine do it when I can't.  Or, if you could redirect me to a place that explains how to do it, please do so.  My dad said there isn't, but I just had to make sure.  Thanks. Privilege banner buggy? Or am I just confused? On the main Stack Overflow site, I arrived and had a banner: "Congrats, you've gained the privilege – create wiki posts and 3 other privileges" This confuses me, because I only see two privileges listed at 100%. Is the banner just buggy?  Or is there a better place to see my privileges that the page linked to by that banner? How to get to the GRUB menu at boot-time? I just saw Get Out, and there's one thing I don't understand.  Georgina turns out to be controlled by Rose's grandmother; its grandmothers brain in her body. Why then, is Georgina constantly cleaning and being treated like an actual maid.  During the diner scene, we get a glimpse into the kitchen, and we see Georgina holding up a plate in way that suggested that she was made to work and cook. The pose and the fact that she was already standing there holding the plate before Missy enters the kitchen was also quite strange and suggestive.  Also, at the "party" theres a moment that Chris sees Georgina and Missy. For a moment he thinks that Georgina is being involved in the party, but than it turns out the Georgina is just handed empty glasses to take care of.  So this I don't get. If its really grandma inside Georgina, then why is she treated in this way? I am trying to make folder that everyone can view and can't copy,modify.    For all answers.I thinking about specially ms office files. I tried following methods  Software  - copy protect    - anti copy    This method can't protect save as and upload  MS office macro    Users can enable,disable macros.  MS office restriction    This is best choice but can't protect from file uploading.   Almost I found the solution. Way is combination of MS office restriction and restrict access from browsers using firewall or antivirus. But I don't exact how to do this. Why am I allowed to turn my focusing ring beyond infinity? arXiv is smart enough to detect whether your PDF is generated by LaTeX. If it is, arXiv asks for the sources of the PDF instead of the PDF file itself. This is really annoying and inconvenient.  I ask a way to fool the arXiv and avoid PDFs being detected as generated by LaTeX (even if they were indeed).  I have tried this: : "create a pdf from word and then simply insert pages from your article, and delete the word's page".  And it did not work. I am trying to use notepad++ and regular expressions to edit a document. I have text in this format  123.45607894.165@abcd;aba 23.456@av1;084 9871.001@fab:9782581afa   And I need to get only the first part of the line , the one before the @ sign. How would I do that to get this:  123.45607894.165 23.456 9871.001 Is it possible to make the -init method private in Objective-C? How can I display the current branch and folder path in terminal?