0% found this document useful (0 votes)
3 views3 pages

array_UDF

The document outlines the syntax for passing arrays to user-defined functions (UDF) in C and C++. It describes three ways to declare a UDF that accepts an array: using array notation, specifying size, or using a pointer. Additionally, it includes contact information for Bhushan Sarde, presumably the author or instructor.

Uploaded by

swarnimdhoke20
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views3 pages

array_UDF

The document outlines the syntax for passing arrays to user-defined functions (UDF) in C and C++. It describes three ways to declare a UDF that accepts an array: using array notation, specifying size, or using a pointer. Additionally, it includes contact information for Bhushan Sarde, presumably the author or instructor.

Uploaded by

swarnimdhoke20
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

ARRAY

1. Passing array to function:


Syntax: UDF Declaration passing Array

Return_type function_name(array_name); //passing array to UDF

There are 3 ways to declare UDF passing Array:

 Return_type function_name(array_name[]);

Ex: void setarray(arr[]);

 Return_type function_name(array_name[SIZE]);

Ex: void setarray(arr[10]);

 Return_type function_name(type *array_name);

EX: void setarray(int *arr);

Program in C:

Bhushan Sarde------------------------------------Ping: 7741967818-----------------------------Email id: [email protected]

Infosys Computer, Navanit Nagar, Nagpur, 440023.


Program in C++:

2. Passing array to function as a pointer:


Porgram in C++

Bhushan Sarde------------------------------------Ping: 7741967818-----------------------------Email id: [email protected]

Infosys Computer, Navanit Nagar, Nagpur, 440023.


Program in C

Bhushan Sarde------------------------------------Ping: 7741967818-----------------------------Email id: [email protected]

Infosys Computer, Navanit Nagar, Nagpur, 440023.

You might also like