LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (http://www.linuxquestions.org/questions/programming-9/)
-   -   Array of words(strings)- please help! (http://www.linuxquestions.org/questions/programming-9/array-of-words-strings-please-help-818850/)

stefanolima 07-09-2010 03:56 AM

Array of words(strings)- please help!
 
Hi!

I want to create a simple program of arranging words in column. I found that this is like array. I know array of characters whereby you define type as char, whereby array elements are characters, now how to declare array of words so that array elements are words?

thanks

dsk 07-09-2010 04:07 AM

the c language:


char *string[5];
string[0] = "just a test";

grail 07-09-2010 05:16 AM

Although a nice guess by dsk ... any particular language here?
It does help if you provide the full picture.

stefanolima 07-12-2010 05:01 AM

Quote:

Originally Posted by dsk (Post 4028058)
the c language:


char *string[5];
string[0] = "just a test";

Thanks, it worked!

I use c++ tried also
string mystring[10];
mystring[0]="Linux Guru";

grail 07-12-2010 05:15 AM

Please mark as SOLVED once you have a solution.


All times are GMT -5. The time now is 07:30 PM.