Pass Array into a function : Function Parameters « Function « C / ANSI-C

C / ANSI-C
1. assert.h
2. Console
3. ctype.h
4. Data Structure Algorithm
5. Data Type
6. Development
7. File
8. Function
9. Language Basics
10. Macro Preprocessor
11. Math
12. math.h
13. Memory
14. Pointer
15. setjmp.h
16. signal.h
17. Small Application
18. stdio.h
19. stdlib.h
20. String
21. string.h
22. Structure
23. time.h
24. wctype.h
Java
Java Tutorial
Java Source Code / Java Documentation
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
C / ANSI-C » Function » Function ParametersScreenshots 
Pass Array into a function

  
#include <stdio.h>

void printarr(int a[]) {
    int i;
    for(i = 0;i<5;i++) {
        printf(" %d\n",a[i]);
    }
}

main() {
    int a[5];
    int i;
    
    for(i = 0;i<5;i++) {
        a[i]=i; 
    }
    printarr(a);  
}


           
       
Related examples in the same category
1.  Calculating an average using variable argument lists Calculating an average using variable argument lists
2. Computes the area of three triangles
3. Demonstrate the use of pointers and parameter passing
4. Pass value
5. Pass reference
6. A function to increase your salaryA function to increase your salary
7. Pass array with different dimension into function
8. Use function with pointer parameters
9. Define int pointer parameter for a function
10. Pass reference of an int value into function
11. Pass char pointer into function
12. Passing the data type addess into the functionPassing the data type addess into the function
13. Length of the function parameters
14. Return value though parameterReturn value though parameter
15. Pass return value through function parameter
16. Pass array value into function: by array, by empty array and by pointer
17. Define constant function parameter
18. Char pointer as the function parameter
19. Passing parameter by pointer
20. Pass double value into functionPass double value into function
w__w__w_._j___a__v__a2__s__.___c__om | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.