Click here to Skip to main content
15,357,464 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Using Zend library in vc++ Pin
Ash_VCPP20-Jan-10 1:59
MemberAsh_VCPP20-Jan-10 1:59 
Questionarray of differents types (possible?) Pin
George Nistor18-Jan-10 2:28
MemberGeorge Nistor18-Jan-10 2:28 
QuestionRe: array of differents types (possible?) Pin
CPallini18-Jan-10 2:44
mveCPallini18-Jan-10 2:44 
AnswerRe: array of differents types (possible?) Pin
George Nistor18-Jan-10 20:57
MemberGeorge Nistor18-Jan-10 20:57 
GeneralRe: array of differents types (possible?) Pin
CPallini18-Jan-10 21:05
mveCPallini18-Jan-10 21:05 
GeneralRe: array of differents types (possible?) Pin
George Nistor18-Jan-10 22:48
MemberGeorge Nistor18-Jan-10 22:48 
Generalthx, SOLVED Pin
George Nistor21-Jan-10 3:38
MemberGeorge Nistor21-Jan-10 3:38 
Questionarray of diffrent types - still not usefull Pin
George Nistor21-Jan-10 5:20
MemberGeorge Nistor21-Jan-10 5:20 
hi (again what I would like to have is an array of message0, message1...)
please give me a clue if any

I thought I solved it.. unfortunally I cannot refer the buffer I need.
I need   message0._c[0] these buffer to refer to.
the only way is with sintax: Vector[0].msg0._c[0]=1; //ok   // not usefull
i have to apppend .msg0 which is not usefull



// diff types array.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"


typedef struct
{
   unsigned char signal7 : 8;
   unsigned char signal6 : 8;
   unsigned char signal5 : 8;
   unsigned char signal4 : 8;
   unsigned char signal3 : 8;
   unsigned char signal2 : 8;
   unsigned char signal1 : 8;
   unsigned char signal0 : 8;
} msgType0;


typedef union
{
   unsigned char _c[8];
   msgType0 msg0_0;
} buf0;


buf0   message0;



typedef struct
{
   unsigned char signal7 : 8;
   unsigned char signal6 : 8;
   unsigned char signal5 : 8;
   unsigned char signal4 : 8;
   unsigned char signal3 : 8;
   unsigned char signal2 : 8;
   unsigned char signal1 : 8;
   unsigned char signal0 : 8;
} msgType1;


typedef union
{
   unsigned char _c[8];
   msgType1 msg0_1;
} buf1;


buf1   message1;
/// ................................
/// UP is the Driver ..   No changed possible
// X 8 times


int main(int argc, char* argv[])
{
     printf("Hello World!\n");


  
union type_Array
{
   buf0   msg0;
   buf1   msg1;
}   ;


type_Array X1;
type_Array X2;

X1.msg0= message0;
X2.msg1= message1;


type_Array Vector[2];

Vector[0]= X1;
Vector[1]= X2;

// what i would like to refer is this buffer message0._c[0]
message0._c[0]= 1;


Vector[0]._c[0]=1;   //imposible to use because of refering msg0

//Vector[0].msg0._c[0]=1; //ok   // not usefull

     return 0;
}

modified on Thursday, January 21, 2010 11:34 AM

QuestionRe: array of diffrent types - still not usefull Pin
CPallini21-Jan-10 7:42
mveCPallini21-Jan-10 7:42 
QuestionRe: array of diffrent types - still not usefull Pin
George Nistor21-Jan-10 19:26
MemberGeorge Nistor21-Jan-10 19:26 
QuestionPeekMessage and DoEvents Pin
HakunaMatada18-Jan-10 2:17
MemberHakunaMatada18-Jan-10 2:17 
AnswerRe: PeekMessage and DoEvents Pin
Covean18-Jan-10 2:33
MemberCovean18-Jan-10 2:33 
AnswerRe: PeekMessage and DoEvents Pin
Cedric Moonen18-Jan-10 3:01
MemberCedric Moonen18-Jan-10 3:01 
AnswerRe: PeekMessage and DoEvents Pin
Rajesh R Subramanian18-Jan-10 8:49
professionalRajesh R Subramanian18-Jan-10 8:49 
GeneralRe: PeekMessage and DoEvents [modified] Pin
Rozis18-Jan-10 11:49
MemberRozis18-Jan-10 11:49 
GeneralRe: PeekMessage and DoEvents Pin
Rajesh R Subramanian18-Jan-10 19:15
professionalRajesh R Subramanian18-Jan-10 19:15 
GeneralRe: PeekMessage and DoEvents Pin
Rozis19-Jan-10 2:17
MemberRozis19-Jan-10 2:17 
GeneralRe: PeekMessage and DoEvents Pin
CPallini18-Jan-10 20:58
mveCPallini18-Jan-10 20:58 
Questionwin32 dialog Pin
john563218-Jan-10 1:58
Memberjohn563218-Jan-10 1:58 
AnswerRe: win32 dialog Pin
Abhi Lahare18-Jan-10 6:16
MemberAbhi Lahare18-Jan-10 6:16 
QuestionThreading Pin
HakunaMatada18-Jan-10 1:48
MemberHakunaMatada18-Jan-10 1:48 
AnswerRe: Threading Pin
Cedric Moonen18-Jan-10 2:08
MemberCedric Moonen18-Jan-10 2:08 
GeneralRe: Threading Pin
HakunaMatada18-Jan-10 2:11
MemberHakunaMatada18-Jan-10 2:11 
AnswerRe: Threading Pin
Moak18-Jan-10 3:34
MemberMoak18-Jan-10 3:34 
GeneralRe: Threading Pin
HakunaMatada19-Jan-10 1:26
MemberHakunaMatada19-Jan-10 1:26 

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.