473,404 Members | 2,178 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,404 software developers and data experts.

How to emulate union c++ behaviour

I have several binary files, for every file i can have int, double, decimal
values and so on.

I'd like to write an only method in order to read data,
can I write something similar to struct union c++?

Sep 19 '06 #1
1 1297
is it what you need?

http://www.thescripts.com/forum/thread247247.html

or try

http://www.google.ca/search?sourceid...%2b%22union%22

I hope it helps

ThunderMusic

"Tommaso Caldarola" <il********@lcimitero.itwrote in message
news:45**********@x-privat.org...
>I have several binary files, for every file i can have int, double, decimal
values and so on.

I'd like to write an only method in order to read data,
can I write something similar to struct union c++?

Sep 19 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: rohit | last post by:
Hi, Iam confused as to when is the memory freed in this program. #include <stdlib.h> #include <stdio.h> #include <string.h> union test{ char *i;
16
by: Bun Head | last post by:
Does anyone see a problem with.. #include <stdio.h> typedef struct { float x; float y; float z; } _XYZ_;
10
by: tapeesh | last post by:
I created a C file say struct.c with the following structure declarations in the same file struct A { union key { int i; float f; }k1;
18
by: ranjeet.gupta | last post by:
Dear ALL As we know that when we declare the union then we have the size of the union which is the size of the highest data type as in the below case the size should be 4 (For my case and...
8
by: wkaras | last post by:
In my compiler, the following code generates an error: union U { int i; double d; }; U u; int *ip = &u.i; U *up = static_cast<U *>(ip); // error I have to change the cast to...
32
by: =?gb2312?B?zfWzrLey?= | last post by:
Union un { int I; char c; } main() { union un x; x.c=10; x.c=1;
8
by: Giovanni R. | last post by:
Take a look at this code (you can execute it): error_reporting(E_ALL); function byVal( $v) {} function byRef(&$v) {} print '<pre>'; byVal ($first); // gives a notice
18
by: Bryan Parkoff | last post by:
I hate using struct / union with dot between two words. How can I use one word instead of two words because I want the source code look reading clear. three variables are shared inside one...
12
by: Roman Mashak | last post by:
Hello, I'm going through the "UNIX network programming" by R.Stevens and stuck with the following code, determining the endiannes of a host it is running on: #include <stdio.h> #include...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.