Posted by Bo0mer Sat 20th Jan 2007 14:39 - Syntax is C++ - 30 views
Modification of posting from Bo0mer Sat 20th Jan 2007 14:39
Download | New Post | Modify | Diff | Hide line numbers
Modification of posting from Bo0mer Sat 20th Jan 2007 14:39
Download | New Post | Modify | Diff | Hide line numbers
-
#include
-
#include
-
using namespace std;
-
int index(char from[32767], int code, int startpos)
-
{
-
int i, j = 0;
-
if (startpos != 0)
-
int k = startpos;
-
for (i = 0; i < strlen(from); i++)
-
{
-
if ((int)from[i] == code)
-
{
-
i = j; break;
-
}
-
}
-
return j;
-
}
-
-
int main()
-
{
-
char from[32767];
-
char find[1];
-
cin >> from;
-
cin >> find;
-
int startpos = 0;
-
//cin >> startpos;
-
cout << index(from, (int)find[0], startpos);
-
-
return 0;
-
}
PermaLink to this entry https://pastebin.co.uk/9365