search in a string

Discuss topics that apply across the products, such as the PocketC language, or development in general

Postby samourai37 on Thu Apr 22, 2004 12:58 pm

in C we can use a function : strstr(const char *string1, const char string2);

This function return the string2 value index in the string1.

example : strstr("we are the champion","are");
/* return the value index of 'are'*/ 4 here

How many to make that with pocketC ????
samourai37
 
Posts: 2
Joined: Thu Apr 22, 2004 12:36 pm
Location: France

Postby Mikael on Thu Apr 22, 2004 3:08 pm

Is this what you mean?

<b>strstr</b>(string str, string sub, int first) - searches str for a substring sub starting at the character first. Returns the starting position of sub within str or -1 on failure.

Mikael
Mikael
 
Posts: 156
Joined: Sun Apr 13, 2003 9:19 am
Location: Denmark

Postby samourai37 on Fri Apr 23, 2004 8:17 am

Yes Mickael but this function is not implanted in my pocketC
version 3.01.

Exist there a complementary lib or a algo which would make it possible to make the same thing ?????]
samourai37
 
Posts: 2
Joined: Thu Apr 22, 2004 12:36 pm
Location: France

Postby Mikael on Fri Apr 23, 2004 11:46 am

I'm currently using version 6.1.0 and not 6.5.0 due to some problems which are well known with the latest version, when it comes to strings.

All I can suggest, is that you download the latest version. At the time I bought PocketC (about a year and a half ago) I received an e-mail with a link to the Orbworks site which enables you to receive free updates. I'm not sure if this was the case when 3.1.0 was released though. If not, perhaps try buying the new version.

Mikael
Mikael
 
Posts: 156
Joined: Sun Apr 13, 2003 9:19 am
Location: Denmark


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 2 guests

cron