473,568 Members | 2,939 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

new to C - what is this: an array, structure or pointer?

66 New Member
Hello - Please tell me what this is...It looks like an array/structure/prototype/pointer...

Expand|Select|Wrap|Line Numbers
  1. STATIC void *_aname[2][2] = { { &d0, &d1 } , { &d10, &d11 } } ;
  2.  
i've never seen this before please advise. thanks!
Aug 5 '08 #1
1 1729
arnaudk
424 Contributor
Read it from right to left: void *_aname[2][2] is "s 2 by 2 array called _aname of pointers to a STATIC void variables".

STATIC is not a standard C/C++ keyword, the lowercase 'static' is and it means the variable (or pointer here) retains its value even after it falls out of scope, between function calls for example. void means the variable has no type semantics, which is why it should be avoided if possible because it circumvents type-checking which the compiler does for you.

Have a look at this article for more about arrays.

&d0 is the address of the variable d0. If d0 is an integer, then &d0 is of type int*, a pointer to an integer. However since _aname is of type void* the compiler will perform implicit type casting and essentially throw away the int property associated with address of d0 when it assigns it to _aname.
Aug 5 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

6
1676
by: berthelot samuel | last post by:
Hi everyone, This really is a tricky one ! (at least for me:). Actually I haven't found any solution to this problem anywhere... So I'll try to be as clear as possible in my explanations. First, I have the following structure: typedef struct _object3D { float coord; float r, g, b; } object3D;
7
1292
by: Darklight | last post by:
What is written below i will use as a quick reference i just want to make sure i have got it right /* STRUCTURES */ TO DEFINE A STRUCTURE way 1. To declare a structure and instance/s together. struct coord{ /* struct keyword is used to declare a stucture, coord is the structure name or tag */ int x; int y; /* x & y are the...
39
2572
by: gtippery | last post by:
Newbie-ish questions - I've been away from C for a _long_ time. It seems to me that there ought to be easier (or at least shorter) ways to do what this does. It does compile & run for me (with PowerC, a 16-bit DOS compiler); if there are nonstandard or "accidentally-works" aspects, please let me know. {This is the sort of situation where...
204
12937
by: Alexei A. Frounze | last post by:
Hi all, I have a question regarding the gcc behavior (gcc version 3.3.4). On the following test program it emits a warning: #include <stdio.h> int aInt2 = {0,1,2,4,9,16}; int aInt3 = {0,1,2,4,9};
1
3083
by: Jeff | last post by:
I am struggling with the following How do I marshal/access a pointer to an array of strings within a structure Than Jef ----------------------------------------------------------------
7
2795
by: Kathy Tran | last post by:
Hi, Could you please help me how to declare an araay of pointer in C#. In my program I declared an structure public struct SEventQ { public uint uiUserData; public uint uiEvent; public uint uiParam0; public uint uiParam1;
1
3764
by: Jonathan Amend | last post by:
I'm trying to port some C++ code to VB.NET but I have hit a snag. I need to add the pointer of a structure which includes an array to an array and then pass it to an API. Here are the two code snippets: long inbuf; // Array that gets passed to the API struct cmbuf { short cmds; long cm2; } cbuf; // Structure whos pointer must be added to...
8
2460
by: ulyses | last post by:
I'm trying to put pointer to flexible array of structures in other structure. I want to have pointer to array of pixels in screen structure. Here is mine code, but I think it isn't quite all right: struct pixel { int x; int y; int color; };
14
2022
by: code break | last post by:
what is the difference in this pointers decalarition ? int *ptr; and int (*ptr);
10
6355
by: Scott Townsend | last post by:
So I need to talk to a devices that expects all of the bits and bytes I sent it to be in specific places (not yet 100% defined). I wanted to create a structure/class with all of the data in it and then convert that to a byte array, pass it to the device, then get a reply and then convert that to a structure. I'm having issues with making...
0
7604
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7916
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8117
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7660
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
1
5498
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5217
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3651
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3631
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2101
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 we have to send another system

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.