Click to See Complete Forum and Search --> : How about this one
zer0_flaw
Sep 2nd, 2002, 12:44 PM
I want to make an array that contains strings... how do I go about this? For example, in Perl I would type:
@bleh = ("bleh", "blah", "heh", "haha")
That's what I want... an array with strings... but in C. And how do I declare it?
SteveCRM
Sep 2nd, 2002, 12:46 PM
char mystring[len][numwords];
always worked for me
zer0_flaw
Sep 2nd, 2002, 01:20 PM
Does anyone know any tutorials that cover C programming REALLY well... like everything in really great detail. I'm mostly looking for more on strings and arrays. I need a few that are really detailed. Thanks in advance!
Daok
Sep 2nd, 2002, 01:58 PM
char cMyArray[2] = {"ok","bye"};
SteveCRM
Sep 2nd, 2002, 02:15 PM
you can't store "ok" and "bye" in a character...
wey97
Sep 8th, 2002, 03:23 AM
#include <string>
using namespace std;
void main(){
string str[2] = {"ok", "bye"};
}
Kranar
Sep 8th, 2002, 04:37 PM
I would try to avoid using 2 dimensional character arrays for strings.
Make use of the CString library available.
CString works for one string, CStringArray works for an array of CString's. If you need more information just ask and I'll be glad to help you out.
Zaei
Sep 8th, 2002, 05:18 PM
USE the STL string over a CString, as the STL string will be availible with just about any compiler that is worth its salt.
Z.
CornedBee
Sep 9th, 2002, 04:12 AM
CString is also only available with either MFC or ATL, both of which will press you into a predetermined application scheme.
Probably not what you want.
Use the STL string, maybe the STL vector (some people have problems using a vector of strings).
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.