Click here to Skip to main content
15,897,187 members
Home / Discussions / C#
   

C#

 
GeneralRe: How to make different color in different trangle in WPF Pin
Pete O'Hanlon7-Dec-11 23:15
mvePete O'Hanlon7-Dec-11 23:15 
GeneralRe: How to make different color in different trangle in WPF Pin
derek09198-Dec-11 2:45
derek09198-Dec-11 2:45 
QuestionRegenerate Designer Code File? Pin
Richard Andrew x647-Dec-11 11:53
professionalRichard Andrew x647-Dec-11 11:53 
AnswerRe: Regenerate Designer Code File? Pin
PIEBALDconsult7-Dec-11 11:57
mvePIEBALDconsult7-Dec-11 11:57 
GeneralRe: Regenerate Designer Code File? Pin
Richard Andrew x647-Dec-11 11:59
professionalRichard Andrew x647-Dec-11 11:59 
AnswerRe: Regenerate Designer Code File? Pin
Richard MacCutchan7-Dec-11 12:26
mveRichard MacCutchan7-Dec-11 12:26 
AnswerRe: Regenerate Designer Code File? Pin
BillWoodruff7-Dec-11 12:35
professionalBillWoodruff7-Dec-11 12:35 
Questionmultidimensional array index to linear index Pin
Keith Vitali7-Dec-11 11:42
Keith Vitali7-Dec-11 11:42 
Hello all,

I am porting some C# code to C++ and there is a particular bit that has me a bit perplexed. The code is as follows:

C#
byte [,,] data = new byte[d,h,w];
int i=0;

for (int z = 0; z < d; z++)
{
   for (int y = 0; y < h; y++)
   {
     for (int x = 0; x < w; x++)
    {
      data[z,y,x]=bytes[i++];
    }
  }
}


So, the variable "bytes" contains data that I have read from the file. Normally, I would calculate the linear index as follows:

C#
index = (z*h+y)*w+x;


However, this seems to be not be the right thing in this case. I was wondering if someone knows if I am doing something obviously wrong...

Thanks,

Keith
AnswerRe: multidimensional array index to linear index Pin
RaviRanjanKr7-Dec-11 11:46
professionalRaviRanjanKr7-Dec-11 11:46 
GeneralRe: multidimensional array index to linear index Pin
harold aptroot7-Dec-11 11:58
harold aptroot7-Dec-11 11:58 
JokeRe: multidimensional array index to linear index Pin
Peter_in_27807-Dec-11 12:25
professionalPeter_in_27807-Dec-11 12:25 
GeneralRe: multidimensional array index to linear index Pin
harold aptroot7-Dec-11 12:33
harold aptroot7-Dec-11 12:33 
GeneralRe: multidimensional array index to linear index Pin
PIEBALDconsult8-Dec-11 3:31
mvePIEBALDconsult8-Dec-11 3:31 
QuestionC parsing question Pin
Software20077-Dec-11 6:21
Software20077-Dec-11 6:21 
AnswerRe: C parsing question Pin
PIEBALDconsult7-Dec-11 6:45
mvePIEBALDconsult7-Dec-11 6:45 
GeneralRe: C parsing question Pin
Software20077-Dec-11 6:55
Software20077-Dec-11 6:55 
JokeRe: C parsing question Pin
Not Active7-Dec-11 9:01
mentorNot Active7-Dec-11 9:01 
GeneralRe: C parsing question Pin
David Skelly7-Dec-11 22:17
David Skelly7-Dec-11 22:17 
Questionbuild install with sql server 2008 Express Pin
jogisarge7-Dec-11 5:46
jogisarge7-Dec-11 5:46 
AnswerRe: build install with sql server 2008 Express Pin
OriginalGriff7-Dec-11 8:10
mveOriginalGriff7-Dec-11 8:10 
GeneralRe: build install with sql server 2008 Express Pin
David C# Hobbyist.7-Dec-11 14:38
professionalDavid C# Hobbyist.7-Dec-11 14:38 
GeneralRe: build install with sql server 2008 Express Pin
OriginalGriff7-Dec-11 21:35
mveOriginalGriff7-Dec-11 21:35 
AnswerRe: build install with sql server 2008 Express Pin
PIEBALDconsult7-Dec-11 11:25
mvePIEBALDconsult7-Dec-11 11:25 
AnswerRe: build install with sql server 2008 Express Pin
Jitendra Parida - Jeetu7-Dec-11 23:41
Jitendra Parida - Jeetu7-Dec-11 23:41 
QuestionSet paper size to custom(for cheque print Software) Pin
Member 84382697-Dec-11 0:39
Member 84382697-Dec-11 0:39 

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.