Register to reply

Code me the php explode function into c or c++

by rsnd
Tags: code, explode, function
Share this thread:
rsnd
#1
Nov29-04, 09:15 PM
P: 26
can someone code me the php explode function into c or c++ that would work with original strings?
thanks in advance
Phys.Org News Partner Science news on Phys.org
New model helps explain how provisions promote or reduce wildlife disease
Stress can make hard-working mongooses less likely to help in the future
Grammatical habits in written English reveal linguistic features of non-native speakers' languages
dduardo
#2
Nov30-04, 07:16 AM
Emeritus
dduardo's Avatar
P: 1,919
Um, there isn't anything to do if you use the C-style strings since it is already in array format. For example:

char *str = "hello";

printf("%c",str[0]) /*Would print out an h*/
printf("%c",str[1]) /*Would print out an e*/

Same thing applies to the C++ STL strings. The class actually overloads the [] operator so you can access the string just like an array.


Register to reply

Related Discussions
Why don't stars explode? What holds them together? Astronomy & Astrophysics 32
Why don't untapped maple trees explode? Math & Science Software 13
What would cause a black hole to explode? Astronomy & Astrophysics 5
Why do Some Stars Explode ? General Physics 8
How to tell if your head is about to explode...? Biology 9