Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

array of strings 1

Status
Not open for further replies.

alexisdumb

Programmer
May 21, 2002
8
AU
hi,
i'm trying to setup an array of words... basically i want it something like

string words[2] = "word1", "word2", "word3";

i cannot get it to work and have included the string.h header.

i want to keep it simple cos i'm dumb
thanks for any help





 
Hi try: char *words[3] = {"word1", "word2","word3"};

i havent tested it but it should word ! =)
 
ah ha!
thanks for this!
i did remember seeing something with the { and } in it but for the life of me couldn't find it again so dismissed it as something from another language

anyway... this works perfectly though!

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top