Solved

function arguments declaration

Posted on 1999-01-25
1
216 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

New My Cloud Pro Series - organize everything!

With space to keep virtually everything, the My Cloud Pro Series offers your team the network storage to edit, save and share production files from anywhere with an internet connection. Compatible with both Mac and PC, you're able to protect your content regardless of OS.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Which checksum is this? 7 139
Test against App 49 133
sameEnds challenge 3 134
Acrinis True image 2 58
Have you thought about creating an iPhone application (app), but didn't even know where to get started? Here's how: ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Important pre-programming comments: I’ve never tri…
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 create, access, and change arrays in the C programming language.
The goal of this video is to provide viewers with basic examples to understand and use switch statements in the C programming language.

910 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

19 Experts available now in Live!

Get 1:1 Help Now