21644

What does this mean ~method( ){ } [duplicate]

Question:

<blockquote>

<strong>Possible Duplicate:</strong><br /><a href="https://stackoverflow.com/questions/188688/what-does-the-tilde-mean-in-c" rel="nofollow">What does the tilde (~) mean in C#?</a>

</blockquote>

What is the meaing of ~ before a method?

I saw this like here:

~myDirect3dClass() { }

Answer1:

That's the <a href="http://msdn.microsoft.com/en-us/library/66x5fx1b.aspx" rel="nofollow">destructor</a> of a class, aka. the Finalizer.

Answer2:

That is a <a href="http://msdn.microsoft.com/en-us/library/66x5fx1b.aspx" rel="nofollow">destructor</a>.

Answer3:

That is a <a href="http://msdn.microsoft.com/en-us/library/66x5fx1b%28VS.80%29.aspx" rel="nofollow">Destructor</a> method of a class. Destructors are used to destruct instances of classes.

Recommend

  • Struggling with functional extensionality
  • Relative URLs in Sharepoint master page
  • How To Do Multiple Hover On List
  • Pandas: Using the tilde operator to return inverse data with two filters
  • free jqGrid search parameter disappearing in filterToolbar
  • Is it necessary to have static constructors when we follow the “RAII ” way of doing things in C++?
  • Move object without a move constructor
  • Round bracket in string with JDBC prepared statement
  • Why use GC.SuppressFinalize() when there is no Finalizer?
  • what does Tilde image mean in MATLAB?
  • Scope(failure) in C++11?
  • I want to trace logs using a Macro multi parameter always null. problem c++ windows
  • ASP.NET, C# How to Pass a StringQuery to a custom SQL Command
  • Merge list of objects into consistent list based on common matching attribute in Python
  • Insert records if not exist SQL Server 2005
  • Unique Permutations - with exceptions
  • Cloud Code function running twice
  • how does System.Web.HttpRequest::PathInfo work?
  • Element.tagName for python not working
  • Spring Cloud Microservice Architecture Confusion
  • gspread or such: help me get cell coordinates (not value)
  • How can I set a binding to a Combox in a UserControl?
  • SplFileObject error failed to open stream: No such file or directory
  • print() is showing quotation marks in results
  • Play WS (2.2.1): post/put large request
  • Refering to the class itself from within a class mehod in Objective C
  • Exception “firebase.functions() takes … no argument …” when specifying a region for a Cloud Function
  • Highlight one bar in a series in highcharts?
  • Spring security and special characters
  • Trying to switch camera back to front but getting exception
  • Calling of Constructors in a Java
  • Cannot Parse HTML Data Using Android / JSOUP
  • PHP: When would you need the self:: keyword?
  • Free memory of cv::Mat loaded using FileStorage API
  • Angular 2 constructor injection vs direct access
  • Java static initializers and reflection
  • unknown Exception android
  • Programmatically clearing map cache
  • Observable and ngFor in Angular 2
  • Unable to use reactive element in my shiny app