Hello,
In the answer to question 4.8 I see this code (copied and pasted):
-------------------------
void f(ipp)
int **ipp;
{
static int dummy = 5;
*ipp = &dummy;
}
....
int *ip;
f(&ip);
-------------------------
I'm confused about the two first lines. Should'nt the first one be
written 'void f(**ipp)' and the second one scrapped altogether?
If not, I don't understand how the above can be legal.
JFL
--
Jean-François Lemaire 4 1254
Jean-François Lemaire wrote:
Hello,
In the answer to question 4.8 I see this code (copied and pasted):
-------------------------
void f(ipp)
int **ipp;
{
static int dummy = 5;
*ipp = &dummy;
}
...
int *ip;
f(&ip);
-------------------------
I'm confused about the two first lines. Should'nt the first one be
written 'void f(**ipp)' and the second one scrapped altogether?
ITYM `void f(int **ipp)'.
If not, I don't understand how the above can be legal.
Question 11.3 has a useful hint, and 11.4 is worth
a look, too.
-- Er*********@sun .com
On Friday 4 January 2008 17:28, Eric Sosman wrote:
Jean-François Lemaire wrote:
>In the answer to question 4.8 I see this code (copied and pasted):
------------------------- void f(ipp) int **ipp; { static int dummy = 5; *ipp = &dummy; } ...
int *ip; f(&ip); -------------------------
I'm confused about the two first lines. Should'nt the first one be written 'void f(**ipp)' and the second one scrapped altogether?
ITYM `void f(int **ipp)'.
IID (Indeed I Did).
>If not, I don't understand how the above can be legal.
Question 11.3 has a useful hint, and 11.4 is worth
a look, too.
OK, I understand now. I'm not used to reading the old style syntax and
would have never thought it was simply that.
Thanks for pointing me in the right direction.
JFL
--
Jean-François Lemaire
Jean-Francois Lemaire <jf*******@skyn et.bewrites:
In the answer to question 4.8 I see this code (copied and pasted):
-------------------------
void f(ipp)
int **ipp;
{
static int dummy = 5;
*ipp = &dummy;
}
[...]
That's an old-style function definition; it predates the ANSI
standard, but it's still permitted, even in C99.
What I don't know is why the FAQ still uses it here. I see no good
reason not to use a prototype. Probably it's just an oversight. I've
sent e-mail to Steve Summit.
(Sorry about mangling your name; this environment isn't handling
non-ASCII characters very well.)
--
Keith Thompson (The_Other_Keit h) <ks***@mib.or g>
[...]
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
On Friday 4 January 2008 21:26, Keith Thompson wrote:
Jean-Francois Lemaire <jf*******@skyn et.bewrites:
>In the answer to question 4.8 I see this code (copied and pasted):
------------------------- void f(ipp) int **ipp; { static int dummy = 5; *ipp = &dummy; }
[...]
That's an old-style function definition; it predates the ANSI
standard, but it's still permitted, even in C99.
What I don't know is why the FAQ still uses it here. I see no good
reason not to use a prototype. Probably it's just an oversight. I've
sent e-mail to Steve Summit.
Yes, this can be confusing for new users of the language, the intended
audience of the FAQ, who are less likely to have encountered such a
function definition. At least it was confusing for me.
(Sorry about mangling your name; this environment isn't handling
non-ASCII characters very well.)
No excuse needed, I can assure you.
JFL
--
Jean-François Lemaire This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Mohammed Mazid |
last post by:
Hi folks!
Can anyone please help me with this?
I am developing a Quiz program but I am stuck with "multiple answers".
Basically I need some sort of code that would select multiple answers
using check boxes.
For example, a question such as
|
by: Mohammed Mazid |
last post by:
Hi folks!
Can anyone please help me with this?
I am developing a Quiz program but I am stuck with "multiple answers".
Basically I need some sort of code that would select multiple answers
using check boxes.
For example, a question such as
|
by: Dave H |
last post by:
Hello,
I have a query regarding definition lists. Is it good practice
semantically to use the dt and dd elements to mark up questions and
answers in a frequently asked questions list, or FAQ?
Here is an example of just such a usage:
<dl class="faq">
<di>
|
by: Nigel Molesworth |
last post by:
I've Googled, but can't find what I need, perhaps I asking the wrong
question!
I want a "FAQ" page on a web site, I hate those pages that scroll you to
the answer so and I figured that a good way to do it would be to have
hidden content under each question, something like this :
What is the first letter of the alphabet?
|
by: amelia170 |
last post by:
I am creating a database with a yes or no answer for question 1.
Based on that answer, (if they answer yes) they will answer question
2, then three....However, if they answer no to question one, I want
them not to be able to answer question 2 at all.
Ideas?
Thanks so much!
| |
by: Michael C |
last post by:
I want to inherit from Bitmap to add a property but I can't because it's
sealed. Is there any reason to seal a class?
Thanks,
Michael
|
by: Ryan |
last post by:
Although I would like my application to require Question and Answer, I
plan to allow a central administrator to create accounts and then
require users to setup their Question/Answer the first time they login.
Therefore, I was wondering:
Is it possible to set the New User wizard control to permit a blank
Question/Answer WITHOUT turning off...
|
by: Jonathan Wood |
last post by:
In my application, new accounts must be created by an administrator--users
will not create their own. Ideally, the user could then log on and specify
their own password question and answer, and the administrator doesn't even
know what that question and answer is.
I thought I could do this since Membership.CreateUser() includes an overload...
|
by: Ken Fine |
last post by:
I want to add the security question and answer security feature to the
ChangePassword control. I am aware that this functionality is built into the
PasswordRecovery tool. I have implemented the PasswordRecovery with a
Password reset required; a temporary password is sent to the account on
file. I want an extra layer of security to accommodate...
|
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
|
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...
| |
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...
|
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
|
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...
|
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...
|
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: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |