Click here to Skip to main content
15,923,083 members
Home / Discussions / C#
   

C#

 
GeneralRe: Convert vs parse Pin
Charlie Williams25-Aug-04 4:53
Charlie Williams25-Aug-04 4:53 
GeneralRe: Convert vs parse Pin
Nick Parker25-Aug-04 5:20
protectorNick Parker25-Aug-04 5:20 
GeneralRe: Convert vs parse Pin
Not Active25-Aug-04 6:00
mentorNot Active25-Aug-04 6:00 
GeneralClass field initialisation question. Pin
Dr Herbie25-Aug-04 3:21
Dr Herbie25-Aug-04 3:21 
GeneralRe: Class field initialisation question. Pin
Norman-Timo25-Aug-04 3:29
Norman-Timo25-Aug-04 3:29 
GeneralRe: Class field initialisation question. Pin
Not Active25-Aug-04 3:34
mentorNot Active25-Aug-04 3:34 
GeneralRe: Class field initialisation question. Pin
leppie25-Aug-04 5:09
leppie25-Aug-04 5:09 
GeneralRe: Class field initialisation question. Pin
Nick Parker25-Aug-04 5:26
protectorNick Parker25-Aug-04 5:26 
GeneralRe: Class field initialisation question. Pin
Heath Stewart25-Aug-04 9:27
protectorHeath Stewart25-Aug-04 9:27 
GeneralThank You Pin
Dr Herbie25-Aug-04 22:08
Dr Herbie25-Aug-04 22:08 
GeneralExcel 2003 Custom Toolbar Flickers when any VBA Macro runs in the Excel Contest Pin
kellap25-Aug-04 1:54
kellap25-Aug-04 1:54 
GeneralOffice Excel 2003 with Information Bridge Framwork Pin
kellap25-Aug-04 1:50
kellap25-Aug-04 1:50 
GeneralRe: Office Excel 2003 with Information Bridge Framwork Pin
Heath Stewart25-Aug-04 9:33
protectorHeath Stewart25-Aug-04 9:33 
GeneralException in web services Pin
Diego F.25-Aug-04 0:18
Diego F.25-Aug-04 0:18 
GeneralRe: Exception in web services Pin
Salil Khedkar25-Aug-04 2:54
Salil Khedkar25-Aug-04 2:54 
GeneralRe: Exception in web services Pin
Salil Khedkar25-Aug-04 2:59
Salil Khedkar25-Aug-04 2:59 
GeneralRe: Exception in web services Pin
Nick Parker25-Aug-04 5:37
protectorNick Parker25-Aug-04 5:37 
GeneralCheck if TCP/IP partner disconnected... Pin
Norman-Timo24-Aug-04 23:18
Norman-Timo24-Aug-04 23:18 
GeneralRe: Check if TCP/IP partner disconnected... Pin
leppie25-Aug-04 1:45
leppie25-Aug-04 1:45 
GeneralRe: Check if TCP/IP partner disconnected... Pin
Norman-Timo25-Aug-04 3:16
Norman-Timo25-Aug-04 3:16 
GeneralRe: Check if TCP/IP partner disconnected... Pin
Sebastian Schneider25-Aug-04 4:54
Sebastian Schneider25-Aug-04 4:54 
GeneralRe: Check if TCP/IP partner disconnected... Pin
Norman-Timo25-Aug-04 20:54
Norman-Timo25-Aug-04 20:54 
QuestionCan anybody explain me how does casting work *internally*? Pin
Salil Khedkar24-Aug-04 20:40
Salil Khedkar24-Aug-04 20:40 
AnswerRe: Can anybody explain me how does casting work *internally*? Pin
leppie24-Aug-04 21:06
leppie24-Aug-04 21:06 
AnswerRe: Can anybody explain me how does casting work *internally*? Pin
Sebastian Schneider25-Aug-04 5:12
Sebastian Schneider25-Aug-04 5:12 
The compiler knows how he stores every variable.

The programmer of that compiler just parses for an explicit cast (like (int)myvar) and then says: well, I have to shove these first bits into a new integer-style, then turn them around and here we go....

Casting is all about conversion between different bit arrangements.

Everything is stored as bits in your memory. By declaring variables or designing your class, you also did a description of how these objects or whatever are stored in memory.

Of course, for SOME types, there is no logical conversion. It DOES NOT MAKE SENSE to cast a string into an integer or the other way round.

In these cases, you need to PARSE your stuff, which takes much longer (microcode-wise) than simply rearraning your bits in a given pattern.

Really, just think about it. Everything is bits. You have an signed integer and want to cast it into an unsigned long. What do you have to do?
basically, substract one, then xor with all ones (like 01010011 ^ 11111111)
you then have the "normal" representation of your number, now just remove the sign and...

And so on.

Computers work by rules. If you know these rules, you just have to write them down into a program.

Still, writing a compiler is something I wish I never have to do.

Cheers
Sebs

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.