Click here to Skip to main content
15,898,889 members
Home / Discussions / C#
   

C#

 
AnswerRe: HTML/String parsing Pin
Liron Hirsch4-Oct-06 1:49
Liron Hirsch4-Oct-06 1:49 
AnswerRe: HTML/String parsing Pin
Ravi Bhavnani4-Oct-06 4:12
professionalRavi Bhavnani4-Oct-06 4:12 
QuestionDynamic cast in C# Pin
WSonck4-Oct-06 1:14
WSonck4-Oct-06 1:14 
AnswerRe: Dynamic cast in C# Pin
User 66584-Oct-06 1:20
User 66584-Oct-06 1:20 
GeneralRe: Dynamic cast in C# Pin
WSonck4-Oct-06 1:33
WSonck4-Oct-06 1:33 
AnswerRe: Dynamic cast in C# Pin
Colin Angus Mackay4-Oct-06 1:37
Colin Angus Mackay4-Oct-06 1:37 
GeneralRe: Dynamic cast in C# Pin
WSonck4-Oct-06 4:19
WSonck4-Oct-06 4:19 
AnswerRe: Dynamic cast in C# Pin
f*** YOU4-Oct-06 5:00
f*** YOU4-Oct-06 5:00 
WSonck wrote:
In C++ there is dynamic_cast<>, but I don't know how to do this in C#. I expect that you can help me.


Don't use is when your casting because first you must find its type and then make the apropriate cast. The as statement is a much better choice as it does both type checking and casting in one operation. Using the is way forces you to check the types type twice because you must first check the type using is and then cast which also checks the type. The as will return null if it not compatible with that type.


SomeObject sobj = new SomeObject();

ADifferentObject diffObj = sobj as SomeObject(); //will return null if SomeObject is not a base class of ADiffObject



=====Brain melting code=====
static int Sqrt(int x){ if (x<0) throw new ArgumentOutOfRangeException(); int temp, y=0, b=0x8000, bshft=15, v=x; do { if (v>=(temp=(y<<1)+b<<bshft--)) { y+=b; v-=temp; } } while ((b>>=1)>0); return y; :omg:
====TSI TLFL EEOOLHTG=====
^^^^^^^^^^^^^^^^^
Decode that and you will win.;P
============Hint===========
cout << "33 20 57 4F 52 44 53 62 63 6B 77 6F 72 64 73";

GeneralRe: Dynamic cast in C# Pin
Colin Angus Mackay4-Oct-06 5:50
Colin Angus Mackay4-Oct-06 5:50 
GeneralRe: Dynamic cast in C# Pin
LongRange.Shooter4-Oct-06 6:38
LongRange.Shooter4-Oct-06 6:38 
GeneralRe: Dynamic cast in C# Pin
Colin Angus Mackay4-Oct-06 7:37
Colin Angus Mackay4-Oct-06 7:37 
GeneralRe: Dynamic cast in C# Pin
LongRange.Shooter4-Oct-06 14:20
LongRange.Shooter4-Oct-06 14:20 
GeneralRe: Dynamic cast in C# Pin
Colin Angus Mackay4-Oct-06 21:31
Colin Angus Mackay4-Oct-06 21:31 
QuestionBizzare request Pin
Liron Hirsch4-Oct-06 0:59
Liron Hirsch4-Oct-06 0:59 
JokeRe: Bizzare request Pin
Gael Fraiteur4-Oct-06 1:52
Gael Fraiteur4-Oct-06 1:52 
GeneralRe: Bizzare request Pin
Liron Hirsch4-Oct-06 2:08
Liron Hirsch4-Oct-06 2:08 
QuestionRe: Bizzare request Pin
David Crow4-Oct-06 5:37
David Crow4-Oct-06 5:37 
AnswerRe: Bizzare request Pin
Liron Hirsch4-Oct-06 6:12
Liron Hirsch4-Oct-06 6:12 
AnswerAnyone ?? Pin
Liron Hirsch4-Oct-06 3:29
Liron Hirsch4-Oct-06 3:29 
GeneralRe: Anyone ?? Pin
Dan Neely4-Oct-06 3:37
Dan Neely4-Oct-06 3:37 
GeneralRe: Anyone ?? Pin
led mike4-Oct-06 5:19
led mike4-Oct-06 5:19 
GeneralRe: Anyone ?? Pin
Dan Neely4-Oct-06 5:24
Dan Neely4-Oct-06 5:24 
GeneralRe: Anyone ?? Pin
led mike4-Oct-06 5:30
led mike4-Oct-06 5:30 
AnswerRe: Bizzare request Pin
Andrew Rissing4-Oct-06 4:27
Andrew Rissing4-Oct-06 4:27 
GeneralRe: Bizzare request Pin
benjymous4-Oct-06 4:54
benjymous4-Oct-06 4:54 

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.