Hi,

In message "[ruby-talk:03448] Array of structs in Ruby"
    on 00/06/16, Jilani Khaldi <jilanik / tin.it> writes:

|How to translate this C code in Ruby.

|#include <stdio.h>
|struct person {
|  char name[32];
|};
|struct person p[2];
|int i;
|main()
|{
|for (i = 0; i < 2; i++)
|{
|  printf("\nName: ");
|  scanf("%s", p[i].name);
|}
|printf("\n\n----------");
|for (i = 0; i < 2; i++)
|{
|  printf("\nName: %s", p[i].name);
|  printf("\n");
| }
|return 0;
|}


class Person
  attr_accessor :name
end

persons = [Person::new, Person::new]
for p in persons
  p.name = readline()
end
printf("\n\n----------")
for p in persons
  printf "\nName: %s", p.name
  printf "\n"
end
-- 
							matz.