Skip to content

Instantly share code, notes, and snippets.

@HQarroum
Last active July 3, 2024 21:28
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