HI can some one tell me the size of the below structure.
Code c++:
typedef struct Application_s
{
unsigned char cPacketType;
MessageType_et MessageType;
union
{
unsigned char ApplicationId[BROWSER_MAX_TAG_LEN];
MsgInfo_t MsgInfo;
} AppData;
} Application_t ;
typedef enum {
MSG_CONNECTION,
MSG_RESPONSE
}MessageType_et;
typedef struct MsgInfo_s
{
unsigned char DataEncoding;
NetworkInfo_t NetworkData;
ErrorReturn_et Error;
FreeFlow_State_t FreeFlow_RespType;
Param_t Response;
} MsgInfo_t ;
typedef struct NetworkInfo_s
{
unsigned char Msisdn[BROWSER_MAX_ADDR_LEN];
unsigned char Msc[BROWSER_MAX_ADDR_LEN];
unsigned char Hlr[BROWSER_MAX_ADDR_LEN];
unsigned char Imsi[BROWSER_MAX_ADDR_LEN];
unsigned char Location[BROWSER_MAX_TAG_LEN];
unsigned char ConnectionType[BROWSER_MAX_TAG_LEN];
unsigned char wimax_id[MAX_WIMAX_ID_LEN];
} NetworkInfo_t ;
typedef enum {
ERROR_SUCCESS,
ERROR_FAILURE
} ErrorReturn_et;
typedef enum
{
FREEFLOW_CONT,
FREEFLOW_BREAK,
FREEFLOW_ENABLED,
FREEFLOW_DISABLED
}FreeFlow_State_t;
typedef struct Param_s
{
unsigned short DataLen;
unsigned char sDataTag[BROWSER_MAX_TAG_LEN];
union
{
unsigned char sData[BROWSER_MAX_DATA_LEN];
wchar_t wData[BROWSER_MAX_DATA_LEN/2];
} DataText;
} Param_t;
assuming
------------------
Code Java:
public static final int BROWSER_MAX_TAG_LEN = 10;
public static final int BROWSER_MAX_ADDR_LEN = 21;
public static final int MAX_WIMAX_ID_LEN = 13;
public static final int BROWSER_MAX_DATA_LEN = 200;
public static final int BROWSER_MAX_LANGCODE_LEN = 2;
public static final int BROWSER_MAX_PARAM_COUNT = 5;
Re: HI can some one tell me the size of the below structure.
Please do not post the same topic under multiple categories, I've removed the others. Also, please use the highlight feature to organize your code. See the official forum rules or my signature on how to do this.
The above looks a lot like C/C++ code (actually, VC++ code specifically), while the bottom is Java code. Have you tried using the sizeof() operator, or looking at the MSDN documentation?