473,463 Members | 1,515 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Definition of obscure pointer/array declaration

6
What is the meaning of the following decaration:

char ( * ( * X( ) )[ ] ) ( )
and
char ( * (*X[5] )( ) ) [10]
Sep 19 '07 #1
6 1814
sicarie
4,677 Expert Mod 4TB
What is the meaning of the following decaration:

char ( * ( * X( ) )[ ] ) ( )
and
char ( * (*X[5] )( ) ) [10]
Have you tried putting that into a compiler and messing around with output statements to see what it is?

What do you think it says?
Sep 19 '07 #2
JosAH
11,448 Expert 8TB
Run cdecl on these little monsters; the person who came up with declarations
like that deserves a head first defenestration. Even some simple typedefs could've
untangled those little creeps.

kind regards,

Jos
Sep 19 '07 #3
sicarie
4,677 Expert Mod 4TB
the person who came up with declarations
like that deserves a head first defenestration. Even some simple typedefs could've
untangled those little creeps.
Why do teachers insist on going through these types of obfuscation exercises, and doing things like "implement a linked list on your own" instead of actually showing people how to use them?
Sep 19 '07 #4
JosAH
11,448 Expert 8TB
Why do teachers insist on going through these types of obfuscation exercises, and doing things like "implement a linked list on your own" instead of actually showing people how to use them?
I think it's the 'revenge of the teachers' who have to grade all that 'stolen', copied
and pasted homework over and over again.

kind regards,

Jos ;-)
Sep 19 '07 #5
Ganon11
3,652 Expert 2GB
...things like "implement a linked list on your own" instead of actually showing people how to use them?
Well, being one of the students who was told to "implement a linked list on your own," I can say that I had no clue how a linked list worked until I built one from the ground up. Now I have a good idea as to how a linked list works, even the one in STL. Sometimes people learn by a "hands-on" approach, by dismantling and rebuilding concepts.
Sep 19 '07 #6
sicarie
4,677 Expert Mod 4TB
Well, being one of the students who was told to "implement a linked list on your own," I can say that I had no clue how a linked list worked until I built one from the ground up. Now I have a good idea as to how a linked list works, even the one in STL. Sometimes people learn by a "hands-on" approach, by dismantling and rebuilding concepts.
I did it too, but I also ended up taking a graduate level java course about a year after that. The things that were taught in there didn't have me re-invent the wheel to learn how a wheel worked, it had me using wheels in every way imaginable to learn how they worked. It's a paradigm shift that I think would greatly benefit students, but is difficult for most teachers to pull off.
Sep 19 '07 #7

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

Similar topics

5
by: pandapower | last post by:
Hi, I know about the equivalence of pointer and arrays.But my doubt comes when its for multidimentional arrays.I have read the C faq but still have some doubts. Suppose I have a declaration as...
12
by: ur8x | last post by:
Why does this declaration give undefined result: file1: extern char * p; file2: char p; Let's assume p has been initialized, now accessing p...
9
by: Christopher Benson-Manica | last post by:
Recently, the following definition was posted to comp.lang.c++: > char **Arr; 1) Is the type of this object "array of 3 (array of two of pointer to pointer to char)"? If not, what is it? ...
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 =...
12
by: junky_fellow | last post by:
How can I declare a function that returns a pointer to one dimensional array ?
8
by: Martin Jørgensen | last post by:
Hi, "C primer plus" p.382: Suppose we have this declaration: int (*pa); int ar1; int ar2; int **p2;
5
by: Ben | last post by:
This is a follow-on from the "Help with array/pointer segmentation fault needed" thread.. I have not been able to find much information on the rules for macros. I want to be able to call a macro...
9
by: joshc | last post by:
Hi, I have an array defined in one file with an intializer as follows: int arr = {0, 1, 2, 3}; I have a declaration of the array in another file as follows: extern int arr;
26
by: aruna.mysore | last post by:
Hi all, I have a specific problem passing a function pointer array as a parameter to a function. I am trying to use a function which takes a function pointer array as an argument. I am too sure...
14
by: Szabolcs Borsanyi | last post by:
Deal all, The type typedef double ***tmp_tensor3; is meant to represent a three-dimensional array. For some reasons the standard array-of-array-of-array will not work in my case. Can I...
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
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,...
1
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...
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...
0
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...
1
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 ...

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.