#include <stdio.h>
void printtest(int *p, int size);
int main(int argc, char* argv[]){
int a[5]={10,20,30,40,50};
int size=sizeof(a)/sizeof(a[0]); // size=(5*int_4byte)/4=5
printtest(a, size/2); // size/2=5/2=2, printtest(a, 2);
return 0;
}
void printtest(int *p, int size){
printf("%d \n", p[size]); //p[2]=30 출력
}
To embed this project on your website, copy the following code and paste it into your website's HTML: