473,503 Members | 1,650 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Shortcut for accessing build-in struct

Hi folks,

I have a question about accessing the member of a build-in struct.

Eg.

struct {
struct {
int x;
int y;
} pt;
int ...
...
} info;

I remember there is a method to simplify the access of info.pt.x using
info.x, but I cannot recall that. Can you guys help me with that?

Thanks a lot.

Best,
Ken

Oct 29 '07 #1
1 1467
ke********@gmail.com wrote On 10/29/07 11:55,:
Hi folks,

I have a question about accessing the member of a build-in struct.

Eg.

struct {
struct {
int x;
int y;
} pt;
int ...
...
} info;

I remember there is a method to simplify the access of info.pt.x using
info.x, but I cannot recall that. Can you guys help me with that?
Some compilers allow "anonymous" struct elements, but
this is not permitted in Standard C (except for a special
case involving bit-fields, not applicable here).

You could play preprocessor games, like

#define X(s) ((s).pt.x)

.... but in my experience such tricks are usually more
trouble than they're worth.

--
Er*********@sun.com
Oct 29 '07 #2

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

Similar topics

4
8828
by: Salad | last post by:
A97. If you set a forms properties to ShortcutMenu = No, the entire form is disabled from displaying a shortcut menu. If you set the property to Yes, all controls have a shortcut menu. I have...
0
2031
by: Pete | last post by:
If using the FileOpenSave common dialog box (ahtCommonFileOpenSave) the text string it extracts is the full path of the file which is great. The problem is if a .url or .lnk (internet shortcut or...
0
1044
by: samlee | last post by:
Does anyone have idea how to write a c# function Shortcut shortcut(bool alt, bool ctrl, bool shift, string key) such that it will return Shortcut.CtrlP Shortcut.CtrlShiftF1 etc for different...
3
1742
by: baroque Chou | last post by:
We build a web site and have some registred user, we want to offer such a feature that the user can access our site from his or her desktop shortcut and want it be log on automatic. So I plan to...
10
1831
by: ad | last post by:
I want to add a shortcut on the user's desktop, the shortcut is a URL to a website (like http://www.microsoft.com) How can I do it with c#?
1
7978
by: Steve M | last post by:
Below is some code adapted from something I think was written by Mark Hammond. Originally I needed to create a Windows shortcut (link), and this code does the trick, requiring only the target...
2
5735
by: Adman | last post by:
All, I am experiencing an issue that has confused me, albiet this is not difficult to do. Any help anyone could provide would be greatly appreciated. After our jdbc calls received the...
0
937
by: Newbie Coder | last post by:
A few years ago I created a shortcut class using the correct functions/COM interfaces(IShellLinkA,/IShellLinkW/GUID's...) I use this class to create shortcuts the correct way not streamwriter but...
1
1572
by: Petty | last post by:
Hy everyone, I wonder how I can erase a shortcut from a removed software? Had pc doctor for windows xp with shortcut key strg+alt+q. now with a german keyboard this shortcut is used for the "at...
0
837
by: max14344 | last post by:
I created one c# project with drag & drop feature. I created setup project which will create a shortcut on user's desktop. It is fine. When I drag a file onto the shortcut it won't work. But if i...
0
7278
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
7328
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6988
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...
1
5011
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...
0
4672
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3166
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
1510
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
734
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
379
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.