Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: HI can some one tell me the size of the below structure.

  1. #1
    Junior Member
    Join Date
    Mar 2011
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Post HI can some one tell me the size of the below structure.

    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
    ------------------
    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;
    Last edited by helloworld922; March 11th, 2011 at 02:25 AM.


  2. #2
    Super Moderator helloworld922's Avatar
    Join Date
    Jun 2009
    Posts
    2,895
    Thanks
    23
    Thanked 619 Times in 561 Posts
    Blog Entries
    18

    Default 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?

Similar Threads

  1. Limit File Size or Request Size
    By tarek.mostafa in forum Java Servlet
    Replies: 3
    Last Post: June 12th, 2010, 04:28 PM
  2. Limit File Size or Request Size
    By tarek.mostafa in forum JavaServer Pages: JSP & JSTL
    Replies: 3
    Last Post: June 11th, 2010, 07:21 AM
  3. .xls data structure
    By helloworld922 in forum JDBC & Databases
    Replies: 3
    Last Post: August 20th, 2009, 07:12 PM