Menu
Menu
DaniWeb
Log In
Sign Up
Read
Contribute
Meet
Search
Search
About 1,000 results for
union
- Page 1
Re: union
Programming
Software Development
17 Years Ago
by ~s.o.s~
union
in C/C++ is basically a mechanism to store more than one of variable at a given memory location. It has a variety of uses. Look [URL="http://www.mycplus.com/cplus.asp?CID=7"]here[/URL] and [URL="http://msdn2.microsoft.com/en-us/library/5dxy4b7b%28VS.80%29.aspx"]here[/URL].
Re: union
Programming
Software Development
17 Years Ago
by Ancient Dragon
…for making sure the items in the
union
are referenced correctly. If you instantiate …the structure contains an int that indicates which
union
member is in use. [code] const … const int AMOUNT_VALUE = 3; struct items { int n;
union
{ short apples; long oranges; float amount; }; }; [/code…
Re: union
Programming
Software Development
17 Years Ago
by Narue
The short story is that a
union
is like a structure except each member shares the memory. The result is that a
union
takes up less space, but you're also restricted to using a single member at a time.
union
Programming
Software Development
17 Years Ago
by complete
I never really got this back in school when I learned C programming and the instructor did a bad job explaining it. What is a
union
in C really and how do you use it?
Union problem
Programming
Software Development
15 Years Ago
by ddanbe
… internal bool theBool; } static void Main(string[] args) {
Union
union
= new
Union
();
union
.theChar = 'A'; //--> when I do this, char …gets messed up
union
.theBool = true; //
union
.theChar = 'A'; --> when I do this,…
Union Site Search with relevance
Programming
Web Development
16 Years Ago
by DiGSGRL
… author LIKE '%$searchTerm1%' or description LIKE '%$searchTerm1%')))
UNION
(SELECT postID,title FROM searchTest2.posts WHERE((title LIKE… DESC [/code] Here is the query with
union
and relevance that does not work: [code]…%' or description LIKE '%$searchTerm1%'))AND locked=0)
UNION
SELECT postID,title ((2*(title LIKE '%$searchTerm1%'))+(1…
Union Site Search with Relevance
Programming
Databases
16 Years Ago
by DiGSGRL
… author LIKE '%$searchTerm1%' or description LIKE '%$searchTerm1%')))
UNION
(SELECT postID,title FROM searchTest2.posts WHERE((title LIKE… DESC [/code] Here is the query with
union
and relevance that does not work: [code]…%' or description LIKE '%$searchTerm1%'))AND locked=0)
UNION
SELECT postID,title, ((2*(title LIKE '%$searchTerm1%'))+(…
Re: Union problem
Programming
Software Development
15 Years Ago
by ddanbe
Thanks for the reply, and believe me this is NO trick question! I thought that a
union
was meant for that, to be two or more things at once. But you are right, after what you said I did some more tests (perhaps I should have done that in the first place) it does not work that way :'( You gave me insights, thanks.
Re: union vs reinterpret_cast<>()
Programming
Software Development
16 Years Ago
by vijayan121
…different values (due to alignment requirements), the
union
and reinterpret_cast would give identical results. an …example showing some of the differences between
union
and reinterpret_cast: [code=c++]#include <iostream…i = 123456789 ; // sets first sizeof(int) bytes of the
union
// ok, interpret the first sizeof(int) bytes as an int…
UNION ALL NOT SHOWING QUERY RESULTS.??
Programming
Software Development
10 Years Ago
by PinoyDev
…first select statement but the 2nd and 3rd
union
was not executed. My backend DB is …filterdate & "')" & _ "
UNION
ALL SELECT SUM(NetAmount) AS totalCreditSales FROM InvoiceMain WHERE InvoiceType… & "')" & _ "
UNION
ALL SELECT SUM(NetAmount) AS totalDriverSales FROM InvoiceMain WHERE InvoiceType…
UNION SQL call original rows
Programming
Databases
6 Years Ago
by SimonIoa
Hello i want to
UNION
three tables from the same database. SELECT DISTINCT …FROM users ORDER BY rand() LIMIT 5) AS T
UNION
ALL (SELECT group_id as id, group_name as name,''…as image_path FROM groups ORDER BY rand() LIMIT 5)
UNION
ALL (SELECT M.msg_id as id, M.title as …
Re: union usage problem
Programming
Software Development
16 Years Ago
by Alex Edwards
… #include<iostream> using namespace std; class Nibble { private:
union
{ int number; }; public: Nibble(int=0); friend ostream& operator… concurrent situations (when information is sent/received quickly - a
Union
is preferable). I only know of the second case because…
Re: union usage problem
Programming
Software Development
16 Years Ago
by Ancient Dragon
… values to individual fields: NO YOU CAN'T. The
union
is used to assign the same memory location to several…Plain Old Data) type objects. All the objects in the
union
below occupy the same space, and the size of the… the size of its largest member. Example: [code]
union
myunion { int a; short b; long c; double d;…
Re: union usage problem
Programming
Software Development
16 Years Ago
by ++C LOVER
…! But we can not use bit field like this without
union
/structure! e.g int num : 4; // illegal [… it's something I need to study. [/QUOTE] [code=c++]
union
{ int bits4 : 4; } [/code] This definition causes 'bits4'… 4-bit fields. Now you can use the usual
union
membership operator to assign values to individual fields: benifit…
union vs reinterpret_cast<>()
Programming
Software Development
16 Years Ago
by Alex Edwards
… there any real different between using an
union
between two types and a reinterpret_cast between two…for example-- [code=c++] #include <iostream> int main(){
union
{ unsigned short *a; float *b; }; float value = 0.…results of the test are the same between the
union
and the reinterpret_cast but I would like to know…
union in java?
Programming
Software Development
16 Years Ago
by gangsta1903
…as follows: [code=C++] typedef struct element{ bool sign;
union
{ char data; element* link; }; element* link; } [/… link is included in every element) and
union
works great in this point. If we… can we find the corresponding of the
union
part? Should we use inheritance as a…
Re: union in java?
Programming
Software Development
16 Years Ago
by stultuske
…as follows: [code=C++] typedef struct element{ bool sign;
union
{ char data; element* link; }; element* link; } [/… link is included in every element) and
union
works great in this point. If we… can we find the corresponding of the
union
part? Should we use inheritance as a…
Re: Union All and Multiple Order By's how?
Programming
Databases
15 Years Ago
by sknake
… should appear in the last query of a
union
but it applies to [b]ALL[/b] data… in the
union
. You will be ordering all of the queries…same column. If you want to have the
union
'd queries ordered by the query order then …as Ordinal from Products where ProductID in (1,4)
union
all select *, 2 as Ordinal from Products where …
Union excess initializers & printing multiple values
Programming
Software Development
15 Years Ago
by Iam3R
… UNS]$ cat U_bc.c int main() {
union
test { char ch; float f; int i; }; //
union
test u={'a',21,34.65}; gives… a warning excess elements
union
test u={100.23}; printf("a=%c i=%d…
union consists of array and struct
Programming
Software Development
13 Years Ago
by murnesty
[CODE]
union
_Test { unsigned char keydata[4]; struct _Member { …12: expected expression before '{' token. If I declare without
union
, [CODE]const unsigned char keydata[NUM_KEYS]={ 2, 1, 6…work and compile success If I declare without array, [CODE]
union
DisplayData { struct data2bytes { unsigned char lbyte; unsigned char hbyte…
Re: UNION SQL call original rows
Programming
Databases
6 Years Ago
by CesarF
…, ... from ( select distinct * from ( select uid as id...
union
select uid as id...
union
select uid as id... ) as SQ1 ) as SQ2…
Re: union usage problem
Programming
Software Development
16 Years Ago
by CoolGamer48
… couple of strange things, but the one related to your
union
: [code]
union
{ int number : 4; }; [/code] What are you trying to…, I don't believe there's a point to a
union
with only one element. I think the error may be…
Re: union vs reinterpret_cast<>()
Programming
Software Development
16 Years Ago
by Radical Edward
The only thing Edward can think of is using a
union
like that isn't required to work even if the conversion is safe but a reinterpret_cast<> is. The rules say that assigning to one member of a
union
and then accessing a different member right away is undefined behavior.
Re: union vs reinterpret_cast<>()
Programming
Software Development
16 Years Ago
by ArkM
… most of C++ implementations reinterpret_cast do nothing (like formally incorrect
union
trick, see Radical Edward's note). If you want to… follows from this that reinterpret_cast is "better" than
union
trick (in the spirit of C++ language). I know (old…
Re: Union excess initializers & printing multiple values
Programming
Software Development
15 Years Ago
by Iam3R
[QUOTE=dkalita;1080584]initialize as [CODE]
union
test u; u.f = 100.23; [/CODE][/QUOTE] i know the basic initialization of
union
. my doubt is why format specifier is not able to convert it in to float value. bcz the value stored in it is a float value.
Re: union of two strings A and B
Programming
Software Development
13 Years Ago
by Momerath
…, characters, whatever). You can then use Linq to get the
union
of the two sets, for example [code]String string1 = "… = string1.Split(','); String[] s2Parts = string2.Split(','); IEnumerable<String>
union
= s1Parts.
Union
(s2Parts); foreach (String s in
union
) { Console.Write(s); }[/code]
Re: UNION ALL NOT SHOWING QUERY RESULTS.??
Programming
Software Development
10 Years Ago
by pritaeas
If you use the
union
the 1st returned record will be totalCashSales, 2nd totalCreditSales, 3rd …
union usage problem
Programming
Software Development
16 Years Ago
by ++C LOVER
…]#include<iostream> using namespace std; class Nibble { private:
union
{ int number : 4; }; public: Nibble(int=0); friend ostream&… bitfield `n->Nibble::<anonymous>.Nibble::<anonymous
union
>::number' to `int&' */ return nin >> …
Re: union usage problem
Programming
Software Development
16 Years Ago
by Alex Edwards
… do it. [code] #include <fstream> using namespace std;
union
myunion { unsigned int x; struct mystruct { unsigned int bit1:1…][/QUOTE] Wow, I think I understood that! Because the entire
union
shares memory across all of the data inside it, when…
Re: union in java?
Programming
Software Development
16 Years Ago
by gangsta1903
…] thanks,this approach seems simpler than class hierarchy equivalent of
union
in C.
1
2
3
17
Next
Last
Search
Search
Forums
Forum Index
Hardware/Software
Recommended Topics
Programming
Recommended Topics
Digital Media
Recommended Topics
Community Center
Recommended Topics
Latest Content
Newest Topics
Latest Topics
Latest Posts
Latest Comments
Top Tags
Topics Feed
Social
Top Members
Meet People
Community Functions
DaniWeb Premium
Newsletter Archive
Markdown Syntax
Community Rules
Developer APIs
Connect API
Forum API Docs
Tools
SEO Backlink Checker
Legal
Terms of Service
Privacy Policy
FAQ
About Us
Advertise
Contact Us
© 2025 DaniWeb® LLC