#include #include //----------------------------------------------------------- // char's place in a string //----------------------------------------------------------- // //Genegal : the program finds char's place in astring // //Input : string and char // //process : the program activates afunction that search's the char in the string // //output : the place in the string that the char shows // //----------------------------------------------------------- //name : DoronJ //----------------------------------------------------------- void show(char st[],char tav,int *ptr) { int i,check=-1; for (i=0;((st+i) !='\0' ) && (check == -1) ;i++) { (st[i]==tav)?check=i:0; } *ptr=check; } void main() { char st[40],tav1; int place; place = 0; tav1 = 0; clrscr(); printf("resom string:"); gets(st); printf("resom tav:"); scanf("%c",&tav1); show(st,tav1,&place); (tav1!=-1)? printf("the char first shows in the %d place in the string",place) :printf("not shows"); getch(); }