Skip to main content

Command Palette

Search for a command to run...

Comparing pointers

Using pointer to an array itself as a loop variable

Updated
•1 min read•View as Markdown
#include <stdio.h>
int main(void)
{
 int a[] = {10, 20, 30, 40, 50};
 int i, *p;
 for(p=a; p<=a+4; p++)
 printf("%d\n", *p);
 return 0;
}

Ouput:

20 views

More from this blog

P

Programming Tutorials

89 posts