Search  Search  

Unsafe Code in C#
  More Programming ... on Twitter on YouTube on flickr on Pinterest on Facebook on Google+ on Tumblr on LinkedIn

Free wallpapers of the hottest girls of the 2014 Winter Olympics

Complete guide for Euro 2012’, about 300 hundred pages filled with comprehensive information about Euro 2012

Euro 12 - teams, managers, players, fixtures, referees, the brand new ‘Tango 12’ Adidas ball and much, much more. Few hundreds amazing photos.

E-books, free e-books, Euro 2012 e-books

Auckland events in photos at

1 500 photos of fun-run 'Ports of Auckland Round the Bays 2012' at

Ocean swim - more than 1 500 photos of State King of the Bays Forums forums Forums - articles, news, links Forums - articles, news, links 

Photos of State King of the Bays event at

‘Complete guide for Euro 2012’: Given profile all 368 footballers with their photos.

‘Complete guide for Euro 2012’: Read about star players of each squad. Find out who is the key player of each team. What Pele expects of Euro 2012?

‘Complete guide for Euro 2012’: Compare annual salary of coaches participating in the Euro-2012 - and how it happened that the team of the most paid coach finished the last in their group?

‘Complete guide for Euro 2012’: Euro 2012 footballers: who are the most expensive players? Who are the Rising stars at Euro 2012?

E-books, free e-books, Euro 2012 e-books
 Rating: 4      Rate this article   29 
 15 Jan 2011

Unsafe Code in C#



In C#, the majority of memory management tasks that a C++ programmer would need to worry about are taken care of automatically. The thorough garbage collection in C# (and the .NET Framework), along with the extensive use of references, means that the C# programmer can write powerful code yet remain totally oblivious to memory management.
However, there are times when it would be useful to have direct access to the memory in order to be able to write code that is more powerful and versatile than regular code. This kind of code is known as unsafe code.

Disadvantages of Unsafe Code

Using unsafe code leads to code that is more complex than regular C# code.
Unsafe code is harder to use than safe code. Using unsafe code makes it easy to do things that aren’t good, like overwrite variables, access memory areas that don’t contain data, or cause a stack overflow.
Unsafe code is a lot harder to debug.
Code which is using pointers is much more likely to hang or crash than safe code.

Advantages of Unsafe Code

Performance gain. Using pointers is the fastest and more efficient way to access and manipulate data.
Using unsafe code allows you to retrieve the memory addresses of data by using pointers. There is no way to do this using safe code.
Unsafe code also allows C# programs to maintain compatibility with old Windows APIs or third-party DLL files that make use of pointers. There are ways of accomplishing this without pointers (such as using DLL Importdeclarations), but it’s usually simpler to use pointers.


  More similar links:

Hardware Requirements for Microsoft Visual Studio 2010

How to copy folder with its permissions?

Unsafe Code in C#

How to test string for a number?

How to fix HTTP Error 404.3 - Not Found (aspx file not recognized by IIS)

How to test string for an Integer?

Drag and drop a file in C# - easy.

 Rate this article from 1 to 5 

        Add comment
Your name:
Your comment:
 Tags: C#, Unsafe, Code, memory management, pointers
   More Programming ...

  Home page Weird We sell Programming Windows
  News Our Photos Photoshop and Photography SQL server Microsoft Office
  Tech News Our Portfolio iPad Misc Web sites development
  Videos Archive Androids Graphic design Software development
  Auckland and New Zealand About Us Tablet PCs CD/DVD presentation Play games online
  Football Contact us Round the Bays 2012 photos Ocean Swim 2012 photos Auckland Events
  Sport Our Portfolio Stock Images Stock Photos Links Exchange
  Hot Girls Our clients On Twitter Add link Site Map
  Our Twitters’ gadget Site Map Google+ Site Grid
  Health and Beauty Site Grid Pinterest Natalia Soft Fern forums
  Misc News Web pages Facebook Photos, images Hair & Beauty
  On YouTube CD/DVD presentaton Tumblr Daily Motion Flickr
  YouTube - 2 Graphics LinkedIn Live Journal Stumble Upon
  Vimeo - videos Tutorials - Videos Tutorials - Weird Most Popular on Internet Yahts, boats, Tall Ships

SoftFern (New Zealand LTD). 
Design and development by SoftFern 2003 - 2014 Graphics supplied by