PageRenderTime 4ms CodeModel.GetById 1ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/www.cppreference.com/wiki/tr/c/string/strstr

https://github.com/tsgates/cclookup
#! | 66 lines | 62 code | 4 blank | 0 comment | 0 complexity | 9d726f9c116e4ef27d687f03e9328aab MD5 | raw file
 1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
 2 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 3<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="tr"
 4 lang="tr" dir="ltr">
 5<head>
 6  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 7  <title>tr:c:string:strstr</title>
 8<meta name="generator" content="DokuWiki" />
 9<meta name="robots" content="index,follow" />
10<meta name="date" content="2010-10-28T18:17:27-0700" />
11<meta name="keywords" content="tr,c,string,strstr" />
12<link rel="search" type="application/opensearchdescription+xml" href="http://www.cppreference.com/wiki/lib/exe/opensearch.php" title="C++ Reference" />
13<link rel="start" href="../../../../index.html" />
14<link rel="contents" href="http://www.cppreference.com/wiki/tr/c/string/strstr?do=index" title="İndeks" />
15<link rel="alternate" type="application/rss+xml" title="Recent Changes" href="http://www.cppreference.com/wiki/feed.php" />
16<link rel="alternate" type="application/rss+xml" title="Current Namespace" href="http://www.cppreference.com/wiki/feed.php?mode=list&amp;ns=tr:c:string" />
17<link rel="alternate" type="text/html" title="Plain HTML" href="http://www.cppreference.com/wiki/_export/xhtml/tr/c/string/strstr" />
18<link rel="alternate" type="text/plain" title="Wiki Markup" href="http://www.cppreference.com/wiki/_export/raw/tr/c/string/strstr" />
19<link rel="canonical" href="strstr" />
20<link rel="stylesheet" media="screen" type="text/css" href="../../../lib/exe/css.php@t=custom1&amp;tseed=1289693594" />
21<link rel="stylesheet" media="all" type="text/css" href="../../../lib/exe/css.php@s=all&amp;t=custom1&amp;tseed=1289693594" />
22<link rel="stylesheet" media="print" type="text/css" href="../../../lib/exe/css.php@s=print&amp;t=custom1&amp;tseed=1289693594" />
23<script type="text/javascript" ><!--//--><![CDATA[//><!--
24var NS='tr:c:string';var JSINFO = {"id":"tr:c:string:strstr","namespace":"tr:c:string"};
25//--><!]]></script>
26<script type="text/javascript" charset="utf-8" src="../../../lib/exe/js.php@tseed=1289693594" ></script>
27</head>
28<body>
29<div class="dokuwiki export">
30
31<h2 class="sectionedit1"><a name="strstr" id="strstr">strstr</a></h2>
32<div class="level2">
33
34<p>
35Söz dizimi:
36</p>
37<pre class="cpp code cpp">    <span class="co2">#include &lt;cstring&gt;</span>
38    <span class="kw4">const</span> <span class="kw4">char</span> <span class="sy2">*</span><span class="kw3">strstr</span><span class="br0">&#40;</span> <span class="kw4">const</span> <span class="kw4">char</span> <span class="sy2">*</span>dizge1, <span class="kw4">const</span> <span class="kw4">char</span> <span class="sy2">*</span>dizge2 <span class="br0">&#41;</span><span class="sy4">;</span>
39          <span class="kw4">char</span> <span class="sy2">*</span><span class="kw3">strstr</span><span class="br0">&#40;</span>       <span class="kw4">char</span> <span class="sy2">*</span>dizge1, <span class="kw4">const</span> <span class="kw4">char</span> <span class="sy2">*</span>dizge2 <span class="br0">&#41;</span><span class="sy4">;</span></pre>
40<p>
41Bu fonksiyon ikinci parametresiyle verilen değeri birnci parametresinde arar, bulduğunda geriye bir işaretçi döndürür. İşaretçi bulunan değerin konumunu göstermektedir. Bulamaması durumunda <code>NULL</code> döndürür. 
42</p>
43
44<p>
45Örneğin:
46</p>
47<pre class="cpp code cpp">    <span class="kw4">char</span><span class="sy2">*</span> dizge1 <span class="sy1">=</span> <span class="st0">&quot;bu bir karakter kataridir.&quot;</span><span class="sy4">;</span>
48    <span class="kw4">char</span><span class="sy2">*</span> dizge2 <span class="sy1">=</span> <span class="st0">&quot;bir karakter&quot;</span><span class="sy4">;</span>
49    <span class="kw4">char</span><span class="sy2">*</span> sonuc <span class="sy1">=</span> <span class="kw3">strstr</span><span class="br0">&#40;</span> dizge1, dizge2 <span class="br0">&#41;</span><span class="sy4">;</span>
50&nbsp;
51    <span class="kw1">if</span><span class="br0">&#40;</span>sonuc <span class="sy1">==</span> <span class="kw2">NULL</span><span class="br0">&#41;</span>
52         <span class="kw3">printf</span><span class="br0">&#40;</span><span class="st0">&quot;'%s', '%s' icerisinde bulunamadi.<span class="es1">\n</span>&quot;</span>, dizge2, dizge1<span class="br0">&#41;</span><span class="sy4">;</span>
53    <span class="kw1">else</span>
54         <span class="kw3">printf</span><span class="br0">&#40;</span><span class="st0">&quot;Bulunan: '%s'<span class="es1">\n</span>&quot;</span>, sonuc<span class="br0">&#41;</span><span class="sy4">;</span></pre>
55<p>
56Bulunduysa çıktı aşağıdaki gibi olacaktır.
57</p>
58<pre class="cpp code cpp">   Bulunan<span class="sy4">:</span> <span class="st0">'bir karakter kataridir.'</span></pre>
59<p>
60Benzer Başlıklar: <a href="http://www.cppreference.com/wiki/tr/c/string/memchr" class="wikilink2" title="tr:c:string:memchr" rel="nofollow">memchr</a>, <a href="strchr" class="wikilink1" title="tr:c:string:strchr">strchr</a>, <a href="http://www.cppreference.com/wiki/tr/c/string/strcspn" class="wikilink2" title="tr:c:string:strcspn" rel="nofollow">strcspn</a>, <a href="http://www.cppreference.com/wiki/tr/c/string/strpbrk" class="wikilink2" title="tr:c:string:strpbrk" rel="nofollow">strpbrk</a>, <a href="http://www.cppreference.com/wiki/tr/c/string/strrchr" class="wikilink2" title="tr:c:string:strrchr" rel="nofollow">strrchr</a>, <a href="http://www.cppreference.com/wiki/tr/c/string/strspn" class="wikilink2" title="tr:c:string:strspn" rel="nofollow">strspn</a>, <a href="http://www.cppreference.com/wiki/tr/c/string/strtok" class="wikilink2" title="tr:c:string:strtok" rel="nofollow">strtok</a>
61</p>
62
63</div>
64</div>
65</body>
66</html>