Skip to content

Instantly share code, notes, and snippets.

@apotheon
Forked from anonymous/gist:4102e1141db035456789
Last active August 29, 2015 14:14
Show Gist options
  • Select an option

  • Save apotheon/d9ccf1152618823e31c8 to your computer and use it in GitHub Desktop.

Select an option

Save apotheon/d9ccf1152618823e31c8 to your computer and use it in GitHub Desktop.
#include <stdio.h>
int main() {
int i = 0;
int intarray[10] = {1, 2, 7, 4, 3, 7, 3, 9, 5, 0};
char chararray[10] = {'h', 'e', 'l', 'l', 'o', ' ', 'y', 'o', 'u', '\0'};
while (i < 10) {
printf("%d\n", intarray[i]);
++i;
}
i = 0;
while (chararray[i] != '\0') {
printf("%c\n", chararray[i]);
++i;
}
printf("%s\n", chararray);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment