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

anderson's equivalence method

Hi folks,

I was reading narain gehani's book C an advanced introduction

in page no: 51 it is given as follows

anderson suggest that programmers use the following approximate
equivalences with ALGOL like or pascal like declarations and
definitions to help understand and write C declarations and
definitions
(intermediate forms of declarations and definitions are used to help
to determine the equivalences)

when converting a pascal like declaration/definition to a
C declaration/definition or vice versa; *(dereferencing operator)
has a lower precedence than operators [] and ()

EQTO means equivalent to

EX:- int *(*(*x)[6])();
an equivalent pascal like definition is constructed as follows

*(*(*x)[6])() : int

EQTO ( *(*x)[6])() : pointer to int

EQTO (*(*x)[6]) : function returning pointer to int

EQTO *(*x)[6] : function returning pointer to int

EQTO (*x)[6] : pointer to function returning pointer to int

EQTO (*x) : array[0...5] function returning pointer to int

EQTO *x : array[0...5] function returning pointer to int

EQTO x : pointer to array[0...5] function returning pointer
to int

ex:2 char(*(*y())[])();

(*(*y())[])() : char

EQTO (*(*y())[]) : function returning char

EQTO *(*y())[] : function returning char

EQTO (*y())[] : pointer to function returning char

EQTO (*y()) : array of pointer to function returning char

EQTO *y() : array of pointer to function returning char

EQTO y() : pointer to array of pointer to function returning
char

EQTO y : function returning pointer to array of pointer to
function returning char
1) now my question is how good is this method especially when type
qualifiers come into play??
2) Is it better than right to left rule or using a series of
typedef's

Apr 4 '06 #1
0 917

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

Similar topics

2
by: Kelly | last post by:
Hi, I don't have any visual basic background so pls be patient with me. What the newline \n equivalence in visual basic script? Thanks.
41
by: Xah Lee | last post by:
here's another interesting algorithmic exercise, again from part of a larger program in the previous series. Here's the original Perl documentation: =pod merge($pairings) takes a list of...
10
by: Xah Lee | last post by:
another functional exercise with lists. Here's the perl documentation. I'll post a perl and the translated python version in 48 hours. =pod parti(aList, equalFunc) given a list aList of...
26
by: Bj?rn | last post by:
I'm trying to convert some small piece of c++ code to c, only to ease linking it to a third language (I'm not knowledgeable in either c or c++). What would be the the c equivalence of:...
7
by: ben | last post by:
hello, an algorithm book i'm reading talks about the connectivity problem/algorithm. it gives a number of examples where the connectivity problem applies to real life situations (like, the...
9
by: Sisyphus | last post by:
Hi, I have some software that does the following (in an attempt to determine whether the double x, can be represented just as accurately by a float): void test_it(double x) { float y = x;...
2
by: ozbear | last post by:
In C# is there a way to alias or equivalence one type to another? For example, in Delphi, I can say... type TMyFloat = type double; and then cheerfully use TMyFloat in my field definitions,...
1
by: Kenneth P | last post by:
Hi, I'm trying to do some Custom Paging technique with the datagrid object and with the select command in Sql, thus forcing the server to only select those rows from the database that should be...
15
by: jzakiya | last post by:
I'm translating a program in Python that has this IF Then chain IF x1 < limit: --- do a --- IF x2 < limit: --- do b --- IF x3 < limit: --- do c --- .----- ------ IF x10 < limt: ---...
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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
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.