Click here to Skip to main content
15,887,485 members
Home / Discussions / C#
   

C#

 
Questionerror adding 2 Uint16s stored in a List structure Pin
Terry Price25-May-12 0:58
Terry Price25-May-12 0:58 
AnswerRe: error adding 2 Uint16s stored in a List structure Pin
Richard MacCutchan25-May-12 1:05
mveRichard MacCutchan25-May-12 1:05 
GeneralRe: error adding 2 Uint16s stored in a List structure Pin
harold aptroot25-May-12 1:14
harold aptroot25-May-12 1:14 
GeneralRe: error adding 2 Uint16s stored in a List structure Pin
Richard MacCutchan25-May-12 1:33
mveRichard MacCutchan25-May-12 1:33 
AnswerRe: error adding 2 Uint16s stored in a List structure Pin
Luc Pattyn25-May-12 2:17
sitebuilderLuc Pattyn25-May-12 2:17 
GeneralRe: error adding 2 Uint16s stored in a List structure Pin
Richard MacCutchan25-May-12 3:32
mveRichard MacCutchan25-May-12 3:32 
AnswerRe: error adding 2 Uint16s stored in a List structure Pin
Luc Pattyn25-May-12 2:21
sitebuilderLuc Pattyn25-May-12 2:21 
AnswerRe: error adding 2 Uint16s stored in a List structure Pin
BobJanova25-May-12 5:50
BobJanova25-May-12 5:50 
I have to say this really is a case of 'RTFM', the M being 'message' in this case. The error message tells you which line is broken, what the problem is and how to fix it!

You should use List<ushort> but I guess you are and you just didn't manage to type your post correctly (eaten by the HTML parser?) since there is no List class in .Net.

The answer is: toAdd = (ushort)(lhs + rhs)
... but I must ask why you're using ushorts in the first place. Unless you're declaring these lists to directly interface to a ushort-taking API, there's no reason not to just use uint or int in most cases. Arithmetic operations are optimised for 32 bit numbers and you're just slowing yourself down by using 16 bit.
GeneralRe: error adding 2 Uint16s stored in a List structure Pin
harold aptroot25-May-12 6:01
harold aptroot25-May-12 6:01 
GeneralRe: error adding 2 Uint16s stored in a List structure Pin
RobCroll25-May-12 17:11
RobCroll25-May-12 17:11 
GeneralRe: error adding 2 Uint16s stored in a List structure Pin
harold aptroot25-May-12 23:05
harold aptroot25-May-12 23:05 
GeneralRe: error adding 2 Uint16s stored in a List structure Pin
Richard MacCutchan26-May-12 1:00
mveRichard MacCutchan26-May-12 1:00 
GeneralRe: error adding 2 Uint16s stored in a List structure Pin
harold aptroot26-May-12 1:04
harold aptroot26-May-12 1:04 
Questiongeometry combine Error Pin
mukesh methaniya25-May-12 0:41
mukesh methaniya25-May-12 0:41 
AnswerRe: geometry combine Error Pin
Richard MacCutchan25-May-12 1:07
mveRichard MacCutchan25-May-12 1:07 
QuestionResize Button according to windows form size Pin
sankar456724-May-12 21:51
sankar456724-May-12 21:51 
AnswerRe: Resize Button according to windows form size Pin
Cracked-Down24-May-12 22:07
Cracked-Down24-May-12 22:07 
Questiontake text data frome web Pin
sina rahimzadeh24-May-12 20:45
sina rahimzadeh24-May-12 20:45 
AnswerRe: take text data frome web Pin
Eddy Vluggen24-May-12 21:52
professionalEddy Vluggen24-May-12 21:52 
AnswerRe: take text data frome web Pin
AmitGajjar27-May-12 22:12
professionalAmitGajjar27-May-12 22:12 
QuestionComparing Times Pin
AmbiguousName24-May-12 19:57
AmbiguousName24-May-12 19:57 
AnswerRe: Comparing Times Pin
OriginalGriff24-May-12 20:33
mveOriginalGriff24-May-12 20:33 
GeneralRe: Comparing Times Pin
AmitGajjar27-May-12 22:18
professionalAmitGajjar27-May-12 22:18 
AnswerRe: Comparing Times Pin
Apocalypse Now24-May-12 20:53
Apocalypse Now24-May-12 20:53 
AnswerRe: Comparing Times Pin
AmitGajjar27-May-12 22:16
professionalAmitGajjar27-May-12 22:16 

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.