What is the difference between the below codes when passing the array to the function? Which should be used when writing a code?
PS: I would like to know the difference in using int *ptr vs int ptr[] in the function argument.
void foo(int *ptr)
{
...
...
}
void main()
{
int a[]={10,20,30};
foo(a);
}
vs
void foo(int ptr[])
{
...
...
}
void main()
{
int a[]={10,20,30};
foo(a);
}