Click here to Skip to main content
15,918,123 members
Home / Discussions / C#
   

C#

 
AnswerRe: How to detect default instance of SQL Server? Pin
Christian Graus5-Feb-07 21:55
protectorChristian Graus5-Feb-07 21:55 
QuestionNew Editor Pin
GunaChinna5-Feb-07 21:09
GunaChinna5-Feb-07 21:09 
AnswerRe: New Editor Pin
stancrm5-Feb-07 21:13
stancrm5-Feb-07 21:13 
GeneralRe: New Editor Pin
bobsugar2225-Feb-07 21:27
bobsugar2225-Feb-07 21:27 
AnswerRe: New Editor Pin
Mark Porter5-Feb-07 21:25
Mark Porter5-Feb-07 21:25 
AnswerRe: New Editor Pin
GunaChinna5-Feb-07 21:45
GunaChinna5-Feb-07 21:45 
GeneralRe: New Editor Pin
bobsugar2225-Feb-07 22:29
bobsugar2225-Feb-07 22:29 
GeneralRe: New Editor Pin
GunaChinna5-Feb-07 23:03
GunaChinna5-Feb-07 23:03 
GeneralRe: New Editor Pin
stancrm6-Feb-07 0:21
stancrm6-Feb-07 0:21 
GeneralRe: New Editor Pin
GunaChinna6-Feb-07 0:52
GunaChinna6-Feb-07 0:52 
GeneralRe: New Editor Pin
GunaChinna6-Feb-07 0:53
GunaChinna6-Feb-07 0:53 
GeneralRe: New Editor Pin
stancrm6-Feb-07 0:58
stancrm6-Feb-07 0:58 
GeneralRe: New Editor Pin
GunaChinna6-Feb-07 1:11
GunaChinna6-Feb-07 1:11 
GeneralRe: New Editor Pin
stancrm6-Feb-07 1:15
stancrm6-Feb-07 1:15 
GeneralRe: New Editor Pin
GunaChinna6-Feb-07 1:37
GunaChinna6-Feb-07 1:37 
GeneralRe: New Editor Pin
GunaChinna6-Feb-07 1:37
GunaChinna6-Feb-07 1:37 
Questioncopying files Pin
Lol215-Feb-07 20:45
Lol215-Feb-07 20:45 
AnswerRe: copying files Pin
Christian Graus5-Feb-07 21:56
protectorChristian Graus5-Feb-07 21:56 
QuestionNo connection could be made because the target machine actively refused it Pin
M Riaz Bashir5-Feb-07 20:44
M Riaz Bashir5-Feb-07 20:44 
AnswerRe: No connection could be made because the target machine actively refused it Pin
aSarafian5-Feb-07 22:23
aSarafian5-Feb-07 22:23 
GeneralRe: No connection could be made because the target machine actively refused it Pin
M Riaz Bashir5-Feb-07 22:51
M Riaz Bashir5-Feb-07 22:51 
QuestionUsing unsafe sizeof in c# Pin
The Geek5-Feb-07 19:46
The Geek5-Feb-07 19:46 
Hi all,

Thanks in anticipation.

I was working on something that reads a serialized (in vc++) file in c#. So I was using the unsafe sizeof to read or get the size of certain objects. I am providing some code snippet to make the problem comprehensive.

struct Node

{

public struct NodeConsumerSnID

{

Int32 m_nNoOfConsumers;

Int32 m_BranchAboveUniqueID;

}



////////// it is returning 8 Byte



public struct NodeConsumerSnID1

{

Int32 m_nNoOfConsumers;

Int16 m_BranchAboveUniqueID;// int16 or short

}

////////// it is returning 8 Byte



public struct NodeConsumerSnID2

{

Int16 m_nNoOfConsumers;// int16 or short

Int16 m_BranchAboveUniqueID;// int16 or short



}

////////// But it is returning 4 Byte



public struct NodeConsumerSnID3

{

Int16 m_nNoOfConsumers;// int16 or short

Int32 m_BranchAboveUniqueID;

}

////////// it is again returning 8 Byte





Now when I look through the output, sizeof(NodeConsumerSnID) returns 8 byte as expected. Also sizeof(NodeConsumerSnID2) returns 4 byte as expected. But unexpectedly, size0f(NodeConsumerSnID1) and sizeof(NodeConsumerSnID3) returns 8 bytes, whereas the expected value was 6 byte.

Can you please provide me some understanding on the same?

Regards,
Kangkan

-----------------------
Kan...

AnswerRe: Using unsafe sizeof in c# Pin
Christian Graus5-Feb-07 19:48
protectorChristian Graus5-Feb-07 19:48 
GeneralRe: Using unsafe sizeof in c# Pin
The Geek5-Feb-07 20:25
The Geek5-Feb-07 20:25 
Question'System.ComponentModel.win32Exception' Pin
Ankit Aneja5-Feb-07 19:25
Ankit Aneja5-Feb-07 19:25 

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.