Skip to content

Instantly share code, notes, and snippets.

@reu
Created June 12, 2010 18:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save reu/435948 to your computer and use it in GitHub Desktop.
Save reu/435948 to your computer and use it in GitHub Desktop.
Arrays (aula de introdução a programação)
#include <stdio.h>
int main()
{
char *students[3];
int iterator;
students[0] = "Thiago";
students[1] = "Gustavo";
students[2] = "Thomas";
for(iterator = 0; iterator < 3; iterator++)
puts(students[iterator]);
return 0;
}
#include <stdio.h>
int main()
{
int iterator;
// Runtime memory allocation
char *students[] = {"Thiago", "Gustavo", "Thomas"};
for(iterator = 0; iterator < 3; iterator++)
puts(students[iterator]);
return 0;
}
["Thiago", "Gustavo", "Thomas"].each { |student| puts student }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment