C Board  

Go Back   C Board > General Programming Boards > Networking/Device Communication

Reply
 
LinkBack Thread Tools Display Modes
Old 08-23-2009, 12:25 PM   #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?
readraviteja is offline   Reply With Quote
Old 08-23-2009, 12:36 PM   #2
Registered User
 
Join Date: Oct 2001
Posts: 2,110
unions aren't directly an RPC mechanism.
robwhit is offline   Reply With Quote
Old 08-25-2009, 03:30 AM   #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
readraviteja is offline   Reply With Quote
Old 08-25-2009, 08:53 AM   #4
Registered User
 
Join Date: Oct 2001
Posts: 2,110
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.
robwhit is offline   Reply With Quote
Old 08-25-2009, 09:18 AM   #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.

Quote:
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.
sirjis is offline   Reply With Quote
Old 08-25-2009, 09:27 AM   #6
Super Moderator
 
Join Date: Sep 2001
Posts: 4,680
Quote:
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.
sean is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
float data type question Mark S. C++ Programming 3 04-30-2006 09:34 AM
Dikumud maxorator C++ Programming 1 10-01-2005 06:39 AM
C diamonds and perls :°) Carlos A Brief History of Cprogramming.com 7 05-16-2003 10:19 PM
Dynamic list of Objects in External File TechWins C++ Programming 3 12-18-2002 02:05 PM


All times are GMT -6. The time now is 08:23 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.0 RC2

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