Click here to Skip to main content
15,895,084 members
Home / Discussions / C#
   

C#

 
QuestionEditing element in List Pin
Winson Lee21-Aug-08 14:25
Winson Lee21-Aug-08 14:25 
AnswerRe: Editing element in List Pin
Ryan Leckey21-Aug-08 16:11
Ryan Leckey21-Aug-08 16:11 
AnswerRe: Editing element in List Pin
Guffa21-Aug-08 21:34
Guffa21-Aug-08 21:34 
AnswerRe: Editing element in List Pin
Jon Hulatt22-Aug-08 3:44
Jon Hulatt22-Aug-08 3:44 
QuestionHi I need some help with this code Pin
Angelinna21-Aug-08 13:05
Angelinna21-Aug-08 13:05 
AnswerRe: Hi I need some help with this code Pin
Christian Graus21-Aug-08 13:15
protectorChristian Graus21-Aug-08 13:15 
GeneralRe: Hi I need some help with this code Pin
Angelinna21-Aug-08 13:22
Angelinna21-Aug-08 13:22 
GeneralRe: Hi I need some help with this code Pin
Christian Graus21-Aug-08 13:38
protectorChristian Graus21-Aug-08 13:38 
OK, so your first issue is that the code, when it works, will only work once. Because you only reset the array once. Or is it meant to be cumulative ?


Angelinna wrote:
private int negate(int x)
{
if (x == 1) return 0;
return 1;
}


Not sure that you call this, but is it really worth writing a function for ? How about just writing this:

return 1 - x;

and 1-x is something you can just code inline instead of making a call, surely ?

I'd have expected you'd need to use the & operator to work out what bits are set in the original number, what you're doing here seems to me to be doomed to fail.

bitstring[nDecimal] = carry;

This will just crash if nDecimal > 7 and won't ever do anything useful.

Christian Graus

No longer a Microsoft MVP, but still happy to answer your questions.

QuestionRe: Hi I need some help with this code Pin
Angelinna21-Aug-08 14:00
Angelinna21-Aug-08 14:00 
AnswerRe: Hi I need some help with this code Pin
Christian Graus21-Aug-08 15:38
protectorChristian Graus21-Aug-08 15:38 
GeneralRe: Hi I need some help with this code Pin
Guffa21-Aug-08 21:50
Guffa21-Aug-08 21:50 
QuestionHow can I get input from 2 forms? Pin
CopperCircle21-Aug-08 11:33
CopperCircle21-Aug-08 11:33 
AnswerRe: How can I get input from 2 forms? Pin
Christian Graus21-Aug-08 11:44
protectorChristian Graus21-Aug-08 11:44 
AnswerRe: How can I get input from 2 forms? [modified] Pin
DaveyM6921-Aug-08 12:02
professionalDaveyM6921-Aug-08 12:02 
GeneralRe: How can I get input from 2 forms? Pin
ianhunt0121-Aug-08 20:09
ianhunt0121-Aug-08 20:09 
GeneralRe: How can I get input from 2 forms? Pin
DaveyM6921-Aug-08 21:25
professionalDaveyM6921-Aug-08 21:25 
AnswerDO THIS EXEMPLE OK? Pin
nelsonpaixao21-Aug-08 15:30
nelsonpaixao21-Aug-08 15:30 
GeneralRe: DO THIS EXEMPLE OK? Pin
Silvyster21-Aug-08 21:21
Silvyster21-Aug-08 21:21 
AnswerRe: DO THIS EXEMPLE OK? Pin
nelsonpaixao22-Aug-08 13:36
nelsonpaixao22-Aug-08 13:36 
QuestionTest-driven developed project example Pin
sacoskun21-Aug-08 9:24
sacoskun21-Aug-08 9:24 
AnswerRe: Test-driven developed project example Pin
leppie21-Aug-08 22:00
leppie21-Aug-08 22:00 
GeneralRe: Test-driven developed project example Pin
sacoskun22-Aug-08 6:26
sacoskun22-Aug-08 6:26 
QuestionPictureBox trasparency Pin
Member 431105721-Aug-08 9:09
Member 431105721-Aug-08 9:09 
AnswerRe: PictureBox trasparency Pin
Pete O'Hanlon21-Aug-08 11:07
mvePete O'Hanlon21-Aug-08 11:07 
GeneralRe: PictureBox trasparency Pin
radialronnie21-Aug-08 13:06
radialronnie21-Aug-08 13:06 

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.