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

What is the difference between them?

int **a[10];
int *(*a)[10];
int (*a[10])();

Feb 9 '07 #1
7 1220
In article <11**********************@a34g2000cwb.googlegroups .com"zhongshu" <gz****@gmail.comwrites:
int **a[10];
declare a as array 10 of pointer to pointer to int
int *(*a)[10];
declare a as array 10 of pointer to pointer to int
int (*a[10])();
declare a as array 10 of pointer to function returning int

cdecl is your friend.
--
dik t. winter, cwi, kruislaan 413, 1098 sj amsterdam, nederland, +31205924131
home: bovenover 215, 1025 jn amsterdam, nederland; http://www.cwi.nl/~dik/
Feb 9 '07 #2
On Feb 8, 10:04 pm, "Dik T. Winter" <Dik.Win...@cwi.nlwrote:
In article <1170988661.291675.225...@a34g2000cwb.googlegroups .com"zhongshu" <gzs...@gmail.comwrites:
int **a[10];

declare a as array 10 of pointer to pointer to int
int *(*a)[10];

declare a as array 10 of pointer to pointer to int
declare a as pointer to array 10 of pointer to int

Robert Gamble

Feb 9 '07 #3

Dik T. Winter wrote:
In article <11**********************@a34g2000cwb.googlegroups .com"zhongshu" <gz****@gmail.comwrites:
int **a[10];

declare a as array 10 of pointer to pointer to int
int *(*a)[10];

declare a as array 10 of pointer to pointer to int
int (*a[10])();

declare a as array 10 of pointer to function returning int

cdecl is your friend.
cdecl is indeed a great tool. It is discussed in K&R. The man page for
it is really kewl as it contains examples, grammar etc.

But I was wondering if there is a systematic method to do it yourself.
I mean a step by step human understandable approach
--
dik t. winter, cwi, kruislaan 413, 1098 sj amsterdam, nederland, +31205924131
home: bovenover 215, 1025 jn amsterdam, nederland; http://www.cwi.nl/~dik/
Feb 9 '07 #4
On Feb 9, 12:21 am, "quarkLore" <agarwal.prat...@gmail.comwrote:
Dik T. Winter wrote:
In article <1170988661.291675.225...@a34g2000cwb.googlegroups .com"zhongshu" <gzs...@gmail.comwrites:
int **a[10];
declare a as array 10 of pointer to pointer to int
int *(*a)[10];
declare a as array 10 of pointer to pointer to int
int (*a[10])();
declare a as array 10 of pointer to function returning int
cdecl is your friend.

cdecl is indeed a great tool. It is discussed in K&R. The man page for
it is really kewl as it contains examples, grammar etc.

But I was wondering if there is a systematic method to do it yourself.
I mean a step by step human understandable approach
Yes, see http://www.ericgiguere.com/articles/reading-c-
declarations.html.

Robert Gamble

Feb 9 '07 #5
good answer!

"Robert Gamble" <rg*******@gmail.comдÈëÓʼþ
news:11**********************@h3g2000cwc.googlegro ups.com...
On Feb 9, 12:21 am, "quarkLore" <agarwal.prat...@gmail.comwrote:
Dik T. Winter wrote:
In article <1170988661.291675.225...@a34g2000cwb.googlegroups .com>
"zhongshu" <gzs...@gmail.comwrites:
int **a[10];
declare a as array 10 of pointer to pointer to int
int *(*a)[10];
declare a as array 10 of pointer to pointer to int
int (*a[10])();
declare a as array 10 of pointer to function returning int
cdecl is your friend.
cdecl is indeed a great tool. It is discussed in K&R. The man page for
it is really kewl as it contains examples, grammar etc.

But I was wondering if there is a systematic method to do it yourself.
I mean a step by step human understandable approach

Yes, see http://www.ericgiguere.com/articles/reading-c-
declarations.html.

Robert Gamble

Feb 9 '07 #6
guoliang wrote:
>
good answer!
Terrible answer. It was top-posted, losing all connection with the
actual problem. Your answer belongs after the material to which
you reply, after snipping anything immaterial.

--
<http://www.cs.auckland.ac.nz/~pgut001/pubs/vista_cost.txt>
<http://www.securityfocus.com/columnists/423>

"A man who is right every time is not likely to do very much."
-- Francis Crick, co-discover of DNA
"There is nothing more amazing than stupidity in action."
-- Thomas Matthews
Feb 9 '07 #7
In article <45***************@yahoo.com>,
CBFalconer <cb********@maineline.netwrote:
>guoliang wrote:
>>
good answer!

Terrible answer. It was top-posted, losing all connection with the
actual problem. Your answer belongs after the material to which
you reply, after snipping anything immaterial.
Get a life!

Feb 9 '07 #8

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

Similar topics

220
by: Brandon J. Van Every | last post by:
What's better about Ruby than Python? I'm sure there's something. What is it? This is not a troll. I'm language shopping and I want people's answers. I don't know beans about Ruby or have...
54
by: Brandon J. Van Every | last post by:
I'm realizing I didn't frame my question well. What's ***TOTALLY COMPELLING*** about Ruby over Python? What makes you jump up in your chair and scream "Wow! Ruby has *that*? That is SO...
125
by: Sarah Tanembaum | last post by:
Beside its an opensource and supported by community, what's the fundamental differences between PostgreSQL and those high-price commercial database (and some are bloated such as Oracle) from...
8
by: Lian | last post by:
Hi all, It is a newbie's question about html tag "img". The attributes "title" and "alt" for "img" seems having the same function. So what is the main difference between them? Can i use them at...
121
by: typingcat | last post by:
First of all, I'm an Asian and I need to input Japanese, Korean and so on. I've tried many PHP IDEs today, but almost non of them supported Unicode (UTF-8) file. I've found that the only Unicode...
23
by: herrcho | last post by:
What's the difference between STDIN and Keyboard buffer ? when i get char through scanf, i type in some characters and press enter, then, where do the characters go ? to STDIN or Keyboard...
21
by: Alvin Bruney | last post by:
I'm looking at this guy's resume to call him in for an interview and he lists VisualStudio.Net 2003 5 years. C'mon. Is that really possible? He hasn't worked or consulted for MS either.
13
by: Jason Huang | last post by:
Hi, Would someone explain the following coding more detail for me? What's the ( ) for? CurrentText = (TextBox)e.Item.Cells.Controls; Thanks. Jason
2
by: George Shui | last post by:
I use webBrowser to open a Word document, when I use this.webBrowser.dispose(), the WinWord Process end. while I use this.webBrowser = null, GC.Collect() , the WinWord Process still alive. I...
49
by: Zach | last post by:
After having taken a looong break from VB (last used 6.0), I started getting back into programming again, this time with VS 2005. I began reading up on VB.NET from various sources (books,...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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?
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...

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.