Skip to content

Instantly share code, notes, and snippets.

@HQarroum
Created August 2, 2021 23:46
Show Gist options
  • Save HQarroum/c6a59fc8f046118ce28440e98d904233 to your computer and use it in GitHub Desktop.
Save HQarroum/c6a59fc8f046118ce28440e98d904233 to your computer and use it in GitHub Desktop.
Pointer arithmetics - Iterating over an array
#include <unistd.h>
int main(void)
{
const char array[] = "Hello world !";
const char* ptr = array;
while (*ptr) {
write(1, ptr++, 1);
}
return (0);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment