Skip to content

Instantly share code, notes, and snippets.

@MaratB
Last active December 25, 2015 10:39
Show Gist options
  • Save MaratB/6963174 to your computer and use it in GitHub Desktop.
Save MaratB/6963174 to your computer and use it in GitHub Desktop.
#include <conio.h>
#include <stdio.h>
#include <string.h>
main(){
char s[80]= "Война и Мир", *p,
a[80]= "Гитара",
str[]= "ар",
ch= 'и';
p = strchr(s,ch);
if (p){
printf ("Первая буква '%c, ее номер - %d\n", ch, p-s);
p = strrchr(s,ch);
printf("Вторая буква '%c' ее номер - %d\n", ch,p-s);
*p = 'и';
}
p = strstr(a, str);
if (p)
printf("Нашли <%s> â [%s]\n", str,a);
else
printf("Не нашли <%s> â [%s]\n", str,a);
getch();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment