About union data type in c (mod edit: RPC question)

This is a discussion on About union data type in c (mod edit: RPC question) within the Networking/Device Communication forums, part of the General Programming Boards category; what are the implications of union data type in c when it is used for RPC?...

  1. #1
    Registered User
    Join Date
    Aug 2009
    Posts
    2

    About union data type in c (mod edit: RPC question)

    what are the implications of union data type in c when it is used for RPC?

  2. #2
    Registered User
    Join Date
    Oct 2001
    Posts
    2,129
    unions aren't directly an RPC mechanism.

  3. #3
    Registered User
    Join Date
    Aug 2009
    Posts
    2

    reply for unions

    Quote Originally Posted by robwhit View Post
    unions aren't directly an RPC mechanism.
    they are but their syntax is different from C but they look like a switch case syntax as in the following format ,
    Code:
    union identifier switch (declaration) {
    case_list
    }
    but i need their implications only

  4. #4
    Registered User
    Join Date
    Oct 2001
    Posts
    2,129
    that's not valid ANSI or ISO C. where you have 'declaration', would be an expression that has integer type. there is no "union identifier" before the switch keyword.

    if you're talking about an extension to ANSI or ISO C, you haven't said what extension you are talking about.

  5. #5
    Registered User
    Join Date
    Nov 2006
    Posts
    12
    I had no idea what you were talking about, either. I found this page:
    http://www.cs.nyu.edu/courses/spring...2/class07.html
    which indicates that these "unions" are unrelated to c unions. I doubt you'll be able to get any help here on this unless you have a language-related question.

    Unions

    Unions in the RPC definition language look very little like
    their C counterparts.

    In C, a union is a list of components that are conceptually
    overlaid in a storage area.

    In the RPC definition language, a union is a specification
    of data types based on some criteria.

    ...

    The definition of a union follows:

    Code:
           union identifier switch ( declaration ) {
                   case_list
           };
    The identifier is the name of the union.

    The declaration is a simple declaration as defined
    by the C language (an example will follow shortly).

    Based on the value of the declaration, an element of the
    case_list is used.

  6. #6
    Super Moderator
    Join Date
    Sep 2001
    Posts
    4,913
    what are the implications of union data type in c when it is used for RPC?
    First of all, even if your question was C-related, that's a horrible question because it's vague, and we have no idea where you're coming from.

    Second, I'm moving this to the networking forum. But please bear in mind that this forum caters primarily to C and C++ programmers - you'll find that most people don't want to the board filling up with general tech questions about other languages and protocols. Even the networking board exists to deal sepcifically with networking in the context of those languages.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. float data type question
    By Mark S. in forum C++ Programming
    Replies: 3
    Last Post: 04-30-2006, 10:34 AM
  2. Dikumud
    By maxorator in forum C++ Programming
    Replies: 1
    Last Post: 10-01-2005, 07:39 AM
  3. C diamonds and perls :)
    By Carlos in forum A Brief History of Cprogramming.com
    Replies: 7
    Last Post: 05-16-2003, 11:19 PM
  4. Dynamic list of Objects in External File
    By TechWins in forum C++ Programming
    Replies: 3
    Last Post: 12-18-2002, 02:05 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21