?
Solved

function arguments declaration

Posted on 1999-01-25
1
Medium Priority
?
250 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 200 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

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…
Summary: This tutorial covers some basics of pointer, pointer arithmetic and function pointer. What is a pointer: A pointer is a variable which holds an address. This address might be address of another variable/address of devices/address of fu…
The goal of this video is to provide viewers with basic examples to understand recursion in the C programming language.
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use for-loops in the C programming language.
Suggested Courses

801 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