473,480 Members | 2,170 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Copying struct

Hi,

I've got the following problem: I've got two structures in different
namespaces that are just the same (name, members, types,...), but - as they
are in different namespaces - I just cannot copy the one into the other,
can't I? Is there any way to do this?

Thanks
Peter
Nov 22 '05 #1
1 1315
Hi Peter,
I've got the following problem: I've got two structures in different
namespaces that are just the same (name, members, types,...), but -
as they are in different namespaces - I just cannot copy the one into
the other, can't I? Is there any way to do this?


Sure, you can copy just the fields. But ...
if you have two structs which are the same in different namespaces, you have
one struct too much - you need to think about your application's design (and
I think you need to change it) ...

Regards,

Frank Eller
www.frankeller.de
Nov 22 '05 #2

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

Similar topics

10
11299
by: David Rasmussen | last post by:
If I have this struct S { int arr; }; and I do this: S s1,s2;
5
17554
by: Roy Hills | last post by:
When I'm reading from or writing to a network socket, I want to use a struct to represent the structured data, but must use an unsigned char buffer for the call to sendto() or recvfrom(). I have...
10
1660
by: Xavier Noria | last post by:
Given two structures of the same size but different type, does C99 guarantee that pointers to them can be casted one to each other, and that the order of the elements will be kind of respected? ...
21
2408
by: hermes_917 | last post by:
I want to use memcpy to copy the contents of one struct to another which is a superset of the original struct (the second struct has extra members at the end). I wrote a small program to test...
5
3270
by: Victor Bazarov | last post by:
Below you will find some code I wrote to see if I could wrap array copying (especially for multi-dimensional arrays) in a simple class and/or function. It seems to work fine for one-dimensioned...
6
3848
by: Johs32 | last post by:
I have made a pcb pointer called current. I have then made another pointer (old_thread) that I initialize to point to the same area that current points to. If I make changes to current...
10
4202
by: webfan | last post by:
In the code below, will the assignment z= y do bitwise copying? struct x { int a; int b; int c; }; main()
9
4242
by: Mr John FO Evans | last post by:
Am looking at adding structures to an embedded C emulator but am wondering what the standard is for copying structures(ie structa=structb) which contain pointers to memory and which are therefore...
2
1383
by: DaTurk | last post by:
This is probably a very silly, and simple question. If I'm coding in CLI, and I want to copy an array to an array, not a deep copy, just something of the nature arr1 = arr2, what is going on? I...
2
7176
by: O.B. | last post by:
When using Marshal to copy data from a byte array to the structure below, only the first byte of the "other" array is getting copied from the original byte array. What do I need to specify to get...
0
6920
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
7060
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
7022
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5365
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
3013
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3004
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1311
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
572
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
206
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.