Solved

C Function

Posted on 2002-05-08
1
221 Views
Last Modified: 2010-04-15
Hi!

How can I pass a pointer to an array through a function?

Tapas
0
Comment
Question by:tapasmondal
1 Comment
 

Accepted Solution

by:
manas_ghosal earned 50 total points
ID: 6996034
it is very simple, let me give u an example:
let the func prototype be:
void func(int *);
in main we pass the pointer to an int array as below:
main(){
   int a[50];
   func(a);
}
0

Featured Post

How our DevOps Teams Maximize Uptime

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us. Read the use case whitepaper.

Question has a verified solution.

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

Suggested Solutions

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…
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 and use structures in the C programming language.
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.

820 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