Created
June 12, 2010 18:04
-
-
Save reu/435948 to your computer and use it in GitHub Desktop.
Arrays (aula de introdução a programação)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
["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