473,396 Members | 1,599 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,396 software developers and data experts.

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

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 1716
arnaudk
424 256MB
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
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,...
7
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....
39
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...
204
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 =...
1
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
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...
1
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...
8
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:...
14
by: code break | last post by:
what is the difference in this pointers decalarition ? int *ptr; and int (*ptr);
10
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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
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...

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.