summaryrefslogtreecommitdiff
path: root/2.3-1/src/c/string/strrchr/gstrrchra.c
blob: 460c1f2f1b1b1bfe07eeb199a9353b36a1532468 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include <stdio.h>
#include <string.h>
#include "strrchr.h"

void gstrrchra(char* str,int size,char* key,int size2,char* out)
{
    int i,j, k=0, pos2;
   
    for (i = 0;i<size;i++)
    {
        if (key[0] == str[i])
        {
            pos2 = i;
        }
    }
	for(j=pos2;j<i;j++)
	{
		out[k]=str[j];
		k++;
	}
}