Click here to Skip to main content
15,885,767 members
Home / Discussions / C#
   

C#

 
GeneralRe: Few question about static class c# Pin
Marco Bertschi25-Mar-13 9:35
protectorMarco Bertschi25-Mar-13 9:35 
GeneralRe: Few question about static class c# Pin
Tridip Bhattacharjee25-Mar-13 9:53
professionalTridip Bhattacharjee25-Mar-13 9:53 
GeneralRe: Few question about static class c# Pin
Marco Bertschi25-Mar-13 10:16
protectorMarco Bertschi25-Mar-13 10:16 
GeneralRe: Few question about static class c# Pin
Tridip Bhattacharjee25-Mar-13 21:31
professionalTridip Bhattacharjee25-Mar-13 21:31 
GeneralRe: Few question about static class c# Pin
Marco Bertschi25-Mar-13 22:20
protectorMarco Bertschi25-Mar-13 22:20 
AnswerRe: Few question about static class c# Pin
DaveyM6925-Mar-13 9:45
professionalDaveyM6925-Mar-13 9:45 
AnswerRe: Few question about static class c# Pin
V.25-Mar-13 23:04
professionalV.25-Mar-13 23:04 
Questionhow memory is allocated for class, class data member and member function & interface and class instance ? Pin
Tridip Bhattacharjee25-Mar-13 4:59
professionalTridip Bhattacharjee25-Mar-13 4:59 
most of the book never explain how memory is allocated for things we use.

i think no memory is allocated for class structure including member function and data member. memory is allocated when we create instance of class.....am i right ?

1) suppose if my class structure is like below one then just tell me how memory will be allocated ?

public class Employee
{
double mydata = 0;
private string _FirstName;

public string FirstName
{
get { return _FirstName; }
set { _FirstName = value ; }
}

private string _LastName;

public string LastName
{
get { return _LastName; }
set { _LastName = value; }
}

public double CalculateValue()
{
return mydata ;
}
}

2) so when i create a instance of employee class then how memory will be allocated for property, data member and member function ?

3) when this line will execute like Employee emp = new Employee(); then how memory will be allocated and also tell me memory will be allocated for which member of that class ?

4) when we call emp.FirstName ="blah" then how memory will be allocated ? and how long data will be stored in memory?

5) any memory is allocated for any interface means IStuden ?

6) we know that for any class instance memory is allocated in heap not stack but i heared that pointer is stored in heap but actual data is stored in stack. so any one can tell me with example how data is stored in heap & stack ? and also in some cases data is only stored in stack.....why ??

7) why one should create static class rather user can declare static method in non-static class and can access those method like

className.MethodName() ? so when and in what kind of scenario user has to create a static class ? is there any advantage of creating

static class ?


i know i have too many question. so i apologized but if possible please give answer in details. thanks
tbhattacharjee

AnswerRe: how memory is allocated for class, class data member and member function & interface and class instance ? Pin
Paulo Zemek25-Mar-13 5:28
mvaPaulo Zemek25-Mar-13 5:28 
GeneralRe: how memory is allocated for class, class data member and member function & interface and class instance ? Pin
Tridip Bhattacharjee25-Mar-13 9:26
professionalTridip Bhattacharjee25-Mar-13 9:26 
GeneralRe: how memory is allocated for class, class data member and member function & interface and class instance ? Pin
Paulo Zemek25-Mar-13 9:46
mvaPaulo Zemek25-Mar-13 9:46 
QuestionAny C# library for Forward error correction. Pin
iamraghusunkara25-Mar-13 4:33
iamraghusunkara25-Mar-13 4:33 
AnswerRe: Any C# library for Forward error correction. Pin
Marco Bertschi25-Mar-13 6:17
protectorMarco Bertschi25-Mar-13 6:17 
AnswerRe: Any C# library for Forward error correction. Pin
unclepaul25-Mar-13 10:44
unclepaul25-Mar-13 10:44 
GeneralRe: Any C# library for Forward error correction. Pin
iamraghusunkara25-Mar-13 19:55
iamraghusunkara25-Mar-13 19:55 
QuestionRemote desktop using VNC Pin
superselector25-Mar-13 1:27
superselector25-Mar-13 1:27 
AnswerRe: Remote desktop using VNC Pin
Richard MacCutchan25-Mar-13 1:35
mveRichard MacCutchan25-Mar-13 1:35 
AnswerRe: Remote desktop using VNC Pin
Eddy Vluggen25-Mar-13 2:03
professionalEddy Vluggen25-Mar-13 2:03 
AnswerRe: Remote desktop using VNC Pin
Marco Bertschi25-Mar-13 6:22
protectorMarco Bertschi25-Mar-13 6:22 
Questiondelegate difficulty Pin
Member 993942324-Mar-13 21:45
Member 993942324-Mar-13 21:45 
AnswerRe: delegate difficulty Pin
Abhinav S24-Mar-13 22:29
Abhinav S24-Mar-13 22:29 
GeneralRe: delegate difficulty Pin
Member 993942325-Mar-13 3:42
Member 993942325-Mar-13 3:42 
GeneralRe: delegate difficulty Pin
PIEBALDconsult25-Mar-13 5:01
mvePIEBALDconsult25-Mar-13 5:01 
AnswerRe: delegate difficulty Pin
Paulo Zemek25-Mar-13 5:34
mvaPaulo Zemek25-Mar-13 5:34 
QuestionHow to use databindings class in web application? Pin
behrad kiani24-Mar-13 6:56
behrad kiani24-Mar-13 6:56 

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.