NO

Author Topic: Help needed on strings  (Read 2992 times)

aravindva

  • Guest
Help needed on strings
« on: August 02, 2007, 05:40:26 PM »
Can somebody help me with the following problem...

It's very urgent..

Given a string and a sub-string as input, write a function to return the number of occurrences and/or position of the first occurrence.

Offline frankie

  • Global Moderator
  • Member
  • *****
  • Posts: 2096
Re: Help needed on strings
« Reply #1 on: August 02, 2007, 06:09:52 PM »
This really seems an homework task.
So to help you try the function "strstr" from standard library (you'll find description in the help).  ::)
prototype:
Code: [Select]
char * strstr(const char *string, const char *substring);
It is better to be hated for what you are than to be loved for what you are not. - Andre Gide