Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR C

Example of Implementation of a pointer to an array in C:

#include<stdio.h>
int main()
{
printf("Welcome to DataFlair tutorials!

");
int i;
double array[5] = {1.1, 2.2, 3.3, 4.4, 5.5};
double *p;
p = array;
printf( "The array is:
");
for ( i = 0; i < 5; i++ )
{
printf("%0.2f
", *(p + i) ); // Pointer to an array
}
return 0;
}
 
PREVIOUS NEXT
Tagged: #Example #Implementation #pointer #array
ADD COMMENT
Topic
Name
7+2 =