Click here to Skip to main content
15,896,526 members
Home / Discussions / C#
   

C#

 
AnswerRe: Custom TabControl: Designer adds TabPages in wrong order! Pin
Revolty7-Apr-13 5:18
Revolty7-Apr-13 5:18 
Questionكيف البحث عن ملفات محرر التسجيل Pin
reemaziz31-Mar-13 6:13
reemaziz31-Mar-13 6:13 
AnswerRe: كيف البحث عن ملفات محرر التسجيل Pin
Kenneth Haugland31-Mar-13 6:49
mvaKenneth Haugland31-Mar-13 6:49 
AnswerRe: كيف البحث عن ملفات محرر التسجيل Pin
Richard MacCutchan31-Mar-13 8:02
mveRichard MacCutchan31-Mar-13 8:02 
Questioninsatling mssql server 2008r2 Pin
Ashbinsapkota31-Mar-13 5:39
Ashbinsapkota31-Mar-13 5:39 
AnswerRe: insatling mssql server 2008r2 Pin
Pete O'Hanlon31-Mar-13 5:52
mvePete O'Hanlon31-Mar-13 5:52 
AnswerRe: insatling mssql server 2008r2 Pin
Abhinav S31-Mar-13 22:40
Abhinav S31-Mar-13 22:40 
QuestionSqlDependency. Can't realize. Pin
Jeka Developer31-Mar-13 0:05
Jeka Developer31-Mar-13 0:05 
AnswerRe: SqlDependency. Can't realize. Pin
Eddy Vluggen31-Mar-13 0:31
professionalEddy Vluggen31-Mar-13 0:31 
GeneralRe: SqlDependency. Can't realize. Pin
Jeka Developer1-Apr-13 2:43
Jeka Developer1-Apr-13 2:43 
AnswerRe: SqlDependency. Can't realize. Pin
Eddy Vluggen1-Apr-13 2:55
professionalEddy Vluggen1-Apr-13 2:55 
GeneralRe: SqlDependency. Can't realize. Pin
Jeka Developer1-Apr-13 4:57
Jeka Developer1-Apr-13 4:57 
GeneralRe: SqlDependency. Can't realize. Pin
Eddy Vluggen1-Apr-13 11:41
professionalEddy Vluggen1-Apr-13 11:41 
GeneralRe: SqlDependency. Can't realize. Pin
Jeka Developer2-Apr-13 10:24
Jeka Developer2-Apr-13 10:24 
GeneralRe: SqlDependency. Can't realize. Pin
Eddy Vluggen3-Apr-13 6:52
professionalEddy Vluggen3-Apr-13 6:52 
AnswerRe: SqlDependency. Can't realize. Pin
jschell1-Apr-13 8:12
jschell1-Apr-13 8:12 
GeneralRe: SqlDependency. Can't realize. Pin
Jeka Developer2-Apr-13 10:26
Jeka Developer2-Apr-13 10:26 
QuestionSNMP Pin
Sahar.H30-Mar-13 22:05
Sahar.H30-Mar-13 22:05 
AnswerRe: SNMP Pin
Pete O'Hanlon30-Mar-13 23:09
mvePete O'Hanlon30-Mar-13 23:09 
QuestionRegarding class instance and memory allocation c# Pin
Tridip Bhattacharjee30-Mar-13 20:33
professionalTridip Bhattacharjee30-Mar-13 20:33 
AnswerRe: Regarding class instance and memory allocation c# Pin
Eddy Vluggen31-Mar-13 1:12
professionalEddy Vluggen31-Mar-13 1:12 
Tridip Bhattacharjee wrote:
1) i just like to know when i will run my program then who call the static main() function
Windows. It loads the assembly, looks for an entrypoint. That your "main" method. To be more specific, the .NET runtime would do that.

Tridip Bhattacharjee wrote:
2) when employee class instance will be created then how memory will be allocated for this class?
Some memory will already have been allocated once the assembly is loaded. Once you create an object of that class, it'll need to allocate memory for those fields (not for the methods). Those fields are either valuetypes (full list of their sizes on MSDN[^]) or Reference types (pointers). Unless those point to an object, their memory-allocation will be limited to space for that pointer.

Tridip Bhattacharjee wrote:
3) where this variable will store in heap or stack ?

Being classmembers, heap.

Six important .NET concepts: Stack, heap, value types, reference types, boxing, and unboxing[^]

Tridip Bhattacharjee wrote:
4) where _local variable will be store when calculatevalue will be called ?
Stack, as all local declared value-types will be.

Tridip Bhattacharjee wrote:
5) the important things is where data is stored when we assign data to variable. in stack or heap ?

Someone is overstating the importance between stack and heap. I feel a truckload of .ToArray conversions coming up for "performance reasons". Valuetypes to the stack, pointers on the stack pointing to lots of bytes in the heap. That's for the executing method; not for every class loaded in the framework.

Tridip Bhattacharjee wrote:
Name="Hello" or Salary=5000 where Hello & 5000

Hello is a string and thus a reference type, salary an integer and a value-type. The first on the heap, second on the stack. Combining them like that would either result in an exception (C#), or a new string (VB) which would be a reference type again.

Tridip Bhattacharjee wrote:
6) where static variable is stored declared in class?

Heap, until it's used.

Tridip Bhattacharjee wrote:
7) static class load into memory when program just run even if i do not call or use them ?

Yes/no. Everything in your assembly will use memory, since it'll be added to the list of "known types loaded". No, it will not run it's static constructor nor allocate memory for it's members until it's first use, as is documented on MSDN.

Tridip Bhattacharjee wrote:
i heard that memory is allocated when we create instance of non-static class. so in case of static class we can not create instance so how they load into memory.

By calling it's constructor[^].

Now here are my questions; why did the interface disappear from this example? And why isn't there a reference to a struct? Would an object in a struct be considered a value-type or a reference-type? What about static structs? Smile | :)

Here's some reading;

Bastard Programmer from Hell Suspicious | :suss:
If you can't read my code, try converting it here[^]

GeneralRe: Regarding class instance and memory allocation c# Pin
Tridip Bhattacharjee1-Apr-13 4:29
professionalTridip Bhattacharjee1-Apr-13 4:29 
GeneralRe: Regarding class instance and memory allocation c# Pin
Eddy Vluggen1-Apr-13 11:49
professionalEddy Vluggen1-Apr-13 11:49 
AnswerRe: Regarding class instance and memory allocation c# Pin
PIEBALDconsult31-Mar-13 4:48
mvePIEBALDconsult31-Mar-13 4:48 
QuestionWCF file upload functionality and message contract usage Pin
Tridip Bhattacharjee30-Mar-13 19:52
professionalTridip Bhattacharjee30-Mar-13 19:52 

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.