|
||
|
GP Mailing List
ATXGPSIG List
|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] RE: Part of a string
I think this is ansi C, so it will be something like this:
char s[] = "Hello";
char c;
c = s[0]; // c == 'H'
or if you print
printf("%c", s[1]); // it will print 'e'
-----Original Message-----
From: gameprogrammer-owner@gameprogrammer.com
[mailto:gameprogrammer-owner@gameprogrammer.com]On Behalf Of Lionel
Pinkhard
Sent: Friday, June 16, 2000 4:00 PM
To: gameprogrammer@gameprogrammer.com
Subject: Part of a string
Hi,
I would like to know how I can extract a single letter from a string,
i.e.:
string = "sometext";
letter[4] = 'e';
letter[8] = 't';
letter[2] = 'o';
Well, I think you get the idea. Could somebody please help? BTW Using GNU
C compiler under Unix.
Ciao,
Lionel
--
"The moon could not continue shining if it had to pay attention to
all the dogs barking at it." - Anonymous
=================================================================
The GameProgrammer.Com mailing list is for the open discussion
of any topic related to the art, science, and business of
programming games. This list is especially tolerant of beginners.
We were all beginners once
To SUBSCRIBE or UNSUBSCRIBE please visit:
http://gameprogrammer.com/mailinglist.html
=================================================================
The GameProgrammer.Com mailing list is for the open discussion
of any topic related to the art, science, and business of
programming games. This list is especially tolerant of beginners.
We were all beginners once
To SUBSCRIBE or UNSUBSCRIBE please visit:
http://gameprogrammer.com/mailinglist.html
|
|