Solved

function arguments declaration

Posted on 1999-01-25
1
238 Views
Last Modified: 2010-05-18
Hi,

I have encountered the following code:

File - aFile.h

void aFunction(char*, char*, int);


File aFile.c

.....

void aFunction(SomeText1, SomeText2, SomeInt)
char SomeText1, SomeText2;
int SomeInt;
{
      ...function body
}  

I am not used with such code.
What confuses me is the declaration of the three argument variables, outside the function body .
I was used with prototyping the function in an .h file, then defining it in the .c file.

Can you please help.

Thanks.
0
Comment
Question by:simi
1 Comment
 
LVL 16

Accepted Solution

by:
imladris earned 50 total points
ID: 1258364
void aFunction(SomeText1, SomeText2, SomeInt)
char SomeText1, SomeText2;
int SomeInt;

This is the original syntax for declaring functions.

Prototypes were added to allow code using the function to do type checking on the arguments, as in the first lines:

void aFunction(char*, char*, int);

The current ANSI standard method does both in one, and is normally used today.

0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

An Outlet in Cocoa is a persistent reference to a GUI control; it connects a property (a variable) to a control.  For example, it is common to create an Outlet for the text field GUI control and change the text that appears in this field via that Ou…
This tutorial is posted by Aaron Wojnowski, administrator at SDKExpert.net.  To view more iPhone tutorials, visit www.sdkexpert.net. This is a very simple tutorial on finding the user's current location easily. In this tutorial, you will learn ho…
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use while-loops in the C programming language.
The goal of this video is to provide viewers with basic examples to understand opening and reading files in the C programming language.

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question