![]() |
| | #1 |
| Registered User Join Date: Mar 2004
Posts: 41
| Storing multiple string in array Code: arrayx[0] = "abc"; arrayx[1] = "def"; |
| winsonlee is offline | |
| | #2 |
| Code Goddess Join Date: Sep 2001
Posts: 9,661
| Assuming your array was declared as Code: char arrayx[2][string_size]; Code: char *arrayx[2]; Code: strcpy ( arrayx[0], "abc" ); strcpy ( arrayx[1], "def" );
__________________ My best code is written with the delete key. |
| Prelude is offline | |
| | #3 |
| Confused Join Date: Sep 2001 Location: Sweden
Posts: 3,122
| Or: Code: char* arrayx[] =
{
"abc",
"def",
"ghijkl"
};
__________________ MagosX.com Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime. |
| Magos is offline | |
![]() |
| Thread Tools | |
| Display Modes | |
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| String issues | The_professor | C++ Programming | 7 | 06-12-2007 09:11 AM |
| RicBot | John_ | C++ Programming | 8 | 06-13-2006 06:52 PM |
| can't assign proper values to an array of string | Duo | C Programming | 1 | 04-04-2005 06:30 AM |
| Help with an Array | omalleys | C Programming | 1 | 07-01-2002 08:31 AM |