Solved

function arguments declaration

Posted on 1999-01-25
1
202 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
Comment Utility
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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

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…
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 how to use strings and some functions related to them 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.

744 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now