All pastes #751528 Raw Edit

Miscellany

public c v1 · immutable
#751528 ·published 2007-10-27 14:36 UTC
rendered paste body
#include<stdio.h>#include<conio.h>//-----------------------------------------------------------//                 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();}