Solved

function arguments declaration

Posted on 1999-01-25
1
243 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Preface I don't like visual development tools that are supposed to write a program for me. Even if it is Xcode and I can use Interface Builder. Yes, it is a perfect tool and has helped me a lot, mainly, in the beginning, when my programs were small…
Windows programmers of the C/C++ variety, how many of you realise that since Window 9x Microsoft has been lying to you about what constitutes Unicode (http://en.wikipedia.org/wiki/Unicode)? They will have you believe that Unicode requires you to use…
The goal of this video is to provide viewers with basic examples to understand opening and writing to files in the C programming language.
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.

737 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