#include%26lt;stdio.h%26gt;
{
void print(int *arr_beg, int *arr_end);
while(arr_beg! = arr_end)
{
printf("%i",*arr);
++arr_beg;
}
}
void main()
{
int arr[] = {0,1,2,3,4,5,6,7,8,9}
print(arr,arr+9);
}
Can some body help me, why i am getting error in this array c pgm?plz help me.thanks in advance.?
1)instead of *arr you should write *arr_beg(in print line 3)
2) ; is missed in you main(first line)
3)correct the place of {} as the person above said
hope it helps
Reply:soem little problems with {}.. try this one:
#include%26lt;stdio.h%26gt;
void print(int *arr_beg, int *arr_end){
while(arr_beg! = arr_end)
{
printf("%i",*arr);
++arr_beg;
}
}
void main()
{
int arr[] = {0,1,2,3,4,5,6,7,8,9}
print(arr,arr+9);
}
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment