Click here to Skip to main content
15,905,874 members
Home / Discussions / C#
   

C#

 
GeneralRe: Save XML Pin
NarVish21-Apr-10 0:09
NarVish21-Apr-10 0:09 
GeneralRe: Save XML Pin
surender.m21-Apr-10 0:21
surender.m21-Apr-10 0:21 
GeneralRe: Save XML Pin
NarVish21-Apr-10 0:51
NarVish21-Apr-10 0:51 
Questionfor loop??? Pin
jellybeannn20-Apr-10 21:57
jellybeannn20-Apr-10 21:57 
Questionsearching in datagridview c# Pin
LenaReu20-Apr-10 21:32
LenaReu20-Apr-10 21:32 
AnswerRe: searching in datagridview c# Pin
sanforjackass20-Apr-10 21:47
sanforjackass20-Apr-10 21:47 
QuestionSession Management with C# Pin
softwarejaeger20-Apr-10 21:29
softwarejaeger20-Apr-10 21:29 
QuestionObject reference not set to an instance of an object Pin
Ice_Freez0520-Apr-10 21:22
Ice_Freez0520-Apr-10 21:22 
AnswerRe: Object reference not set to an instance of an object Pin
OriginalGriff20-Apr-10 21:47
mveOriginalGriff20-Apr-10 21:47 
GeneralRe: Object reference not set to an instance of an object Pin
Ice_Freez0520-Apr-10 22:10
Ice_Freez0520-Apr-10 22:10 
GeneralRe: Object reference not set to an instance of an object Pin
OriginalGriff20-Apr-10 22:22
mveOriginalGriff20-Apr-10 22:22 
GeneralRe: Object reference not set to an instance of an object [modified] Pin
Ice_Freez0520-Apr-10 22:48
Ice_Freez0520-Apr-10 22:48 
GeneralRe: Object reference not set to an instance of an object Pin
OriginalGriff20-Apr-10 22:59
mveOriginalGriff20-Apr-10 22:59 
GeneralRe: Object reference not set to an instance of an object Pin
Ice_Freez0520-Apr-10 23:04
Ice_Freez0520-Apr-10 23:04 
GeneralRe: Object reference not set to an instance of an object Pin
OriginalGriff20-Apr-10 23:33
mveOriginalGriff20-Apr-10 23:33 
GeneralRe: Object reference not set to an instance of an object Pin
Ice_Freez0520-Apr-10 23:47
Ice_Freez0520-Apr-10 23:47 
Questionfreeing a variable Pin
AnirbanChak 20-Apr-10 20:47
AnirbanChak 20-Apr-10 20:47 
AnswerRe: freeing a variable Pin
Stanciu Vlad20-Apr-10 21:04
Stanciu Vlad20-Apr-10 21:04 
GeneralRe: freeing a variable Pin
AnirbanChak 20-Apr-10 23:06
AnirbanChak 20-Apr-10 23:06 
GeneralRe: freeing a variable Pin
Stanciu Vlad20-Apr-10 23:11
Stanciu Vlad20-Apr-10 23:11 
AnswerRe: freeing a variable Pin
Ice_Freez0520-Apr-10 21:06
Ice_Freez0520-Apr-10 21:06 
AnswerRe: freeing a variable Pin
OriginalGriff20-Apr-10 21:08
mveOriginalGriff20-Apr-10 21:08 
It depends on what the variable is:
If it is a value type, then to zero it, assign zero to it:
int i = 0;

If it is a reference type, then is gets more complex. If it implements the IDisposable interface, then it makes some sense to zero it by calling Dispose() - however, this alone will not free memory. However, it is very good practice to use Dispose() (or a using block) where possible to minimize the drain on system resources.
The only way to truly free the memory used by a variable is to remove all references to to it, and allow the garbage collector to do its' thing. This means setting all references to the variable to null, or allowing them to go out of scope.

Unlike C, you have little direct control over memory use in C# - by design, as it is intended that you "can't get the memory leak problems" that C and C++ exhibit. I promise not to laugh at this point...
You should never use standby on an elephant. It always crashes when you lift the ears. - Mark Wallace

C/C++ (I dont see a huge difference between them, and the 'benefits' of C++ are questionable, who needs inheritance when you have copy and paste) - fat_boy

QuestionSend multiple SMS problem using Skype API Pin
Tridip Bhattacharjee20-Apr-10 20:13
professionalTridip Bhattacharjee20-Apr-10 20:13 
Questionauto update Pin
Member 59031020-Apr-10 19:53
Member 59031020-Apr-10 19:53 
AnswerRe: auto update Pin
Calla20-Apr-10 20:18
Calla20-Apr-10 20:18 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.