From: Stefano Crocco Date: 2008-08-31T21:55:31+09:00 Subject: Re: simple, array question! On Sunday 31 August 2008, hwang is wrote: > hi! Gentlemen > > i don't understand array declaration.. > > c languages, array declaration is... > > char str[100]; > > but, how do i declaration an array for ruby.. > > oo is difficult... > > plz teach me .. In ruby you don't have to declare a variable (actually, you can't), you just assign a value to it. For example a = [1, 2, 3, 4] stores an array containing the elements 1, 2, 3 and 4 to the local variable a. By the way, ruby has a String class, so you don't need to use an array of char to represent a string: str = "text" or str = String.new "text" If you're used to C programming, you can look at http://www.ruby-lang.org/en/documentation/ruby-from-other-languages/to-ruby-from-c-and-c-/ to see a list of the differences between ruby and C/C++ I hope this helps Stefano