<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Linux Forum &mdash; String и скобки]]></title>
		<link>https://linuxforum.ru/viewtopic.php?id=30775</link>
		<atom:link href="https://linuxforum.ru/extern.php?action=feed&amp;tid=30775&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «String и скобки».]]></description>
		<lastBuildDate>Thu, 03 Oct 2013 18:13:35 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: String и скобки]]></title>
			<link>https://linuxforum.ru/viewtopic.php?pid=367350#p367350</link>
			<description><![CDATA[<p>не. не забанили пока. Продолжаем веселье.</p><p>И да, C++ всё равно не рекомендую. Что вам в сишечке не нравится? Char* вполне годная замена стрингов. Сам Линус юзает, и нахваливает. И шлёт всех к такой-то матери, кто пожелает C++, или прочую ересь.</p>]]></description>
			<author><![CDATA[null@example.com (drBatty)]]></author>
			<pubDate>Thu, 03 Oct 2013 18:13:35 +0000</pubDate>
			<guid>https://linuxforum.ru/viewtopic.php?pid=367350#p367350</guid>
		</item>
		<item>
			<title><![CDATA[Re: String и скобки]]></title>
			<link>https://linuxforum.ru/viewtopic.php?pid=367312#p367312</link>
			<description><![CDATA[<p>Ладно...</p>]]></description>
			<author><![CDATA[null@example.com (viva_linuxoid)]]></author>
			<pubDate>Thu, 03 Oct 2013 17:19:30 +0000</pubDate>
			<guid>https://linuxforum.ru/viewtopic.php?pid=367312#p367312</guid>
		</item>
		<item>
			<title><![CDATA[Re: String и скобки]]></title>
			<link>https://linuxforum.ru/viewtopic.php?pid=367218#p367218</link>
			<description><![CDATA[<p><strong>viva_linuxoid</strong>, думаю -- не нужно. Тема C++ очень сложна, и у меня нет времени её раскрывать. Да и здешние вахтёры наверное скоро меня опять забанят...</p>]]></description>
			<author><![CDATA[null@example.com (drBatty)]]></author>
			<pubDate>Thu, 03 Oct 2013 12:21:04 +0000</pubDate>
			<guid>https://linuxforum.ru/viewtopic.php?pid=367218#p367218</guid>
		</item>
		<item>
			<title><![CDATA[Re: String и скобки]]></title>
			<link>https://linuxforum.ru/viewtopic.php?pid=367212#p367212</link>
			<description><![CDATA[<p>Можно поточней ?</p>]]></description>
			<author><![CDATA[null@example.com (viva_linuxoid)]]></author>
			<pubDate>Thu, 03 Oct 2013 12:07:24 +0000</pubDate>
			<guid>https://linuxforum.ru/viewtopic.php?pid=367212#p367212</guid>
		</item>
		<item>
			<title><![CDATA[Re: String и скобки]]></title>
			<link>https://linuxforum.ru/viewtopic.php?pid=367200#p367200</link>
			<description><![CDATA[<div class="quotebox"><cite>viva_linuxoid пишет:</cite><blockquote><p>А на c++</p></blockquote></div><p>а на C++ есть стандартная STL, в которой есть нужный вам std::string. Но можно сделать и свой, с картами и девочками.</p>]]></description>
			<author><![CDATA[null@example.com (drBatty)]]></author>
			<pubDate>Thu, 03 Oct 2013 11:50:32 +0000</pubDate>
			<guid>https://linuxforum.ru/viewtopic.php?pid=367200#p367200</guid>
		</item>
		<item>
			<title><![CDATA[Re: String и скобки]]></title>
			<link>https://linuxforum.ru/viewtopic.php?pid=367199#p367199</link>
			<description><![CDATA[<p>можно сделать свою структуру (<em>struct</em>) string, и написать кучу функций для обработки этой структуры.</p><p>ещё можно считать строкой указатель на символ. С двумя допущениями:</p><p>1. это не просто указатель на символ, а указатель на массив, который имеет достаточный для строки размер.</p><p>2. строка оканчивается на \0, и в ней нет символов \0. И размер массива достаточен не только для строки, но и для \0 в конце.</p><p>тогда с такими &quot;строками&quot; можно юзать библиотеку glibc, и все функции, перечисленные в третьем разделе man pages. Например<br /></p><div class="fancy_spoiler_switcher"><div class="fancy_spoiler_switcher_header" data-lang-open="открыть спойлер" data-lang-close="скрыть спойлер"><strong>+</strong>&nbsp;открыть спойлер</div><div class="fancy_spoiler"><p>STRCPY(3)&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Linux Programmer&#039;s Manual&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;STRCPY(3)</p><p>NAME<br />&nbsp; &nbsp; &nbsp; &nbsp;strcpy, strncpy - copy a string</p><p>SYNOPSIS<br />&nbsp; &nbsp; &nbsp; &nbsp;#include &lt;string.h&gt;</p><p>&nbsp; &nbsp; &nbsp; &nbsp;char *strcpy(char *dest, const char *src);</p><p>&nbsp; &nbsp; &nbsp; &nbsp;char *strncpy(char *dest, const char *src, size_t n);</p><p>DESCRIPTION<br />&nbsp; &nbsp; &nbsp; &nbsp;The&nbsp; strcpy() function copies the string pointed to by src, including the terminat-<br />&nbsp; &nbsp; &nbsp; &nbsp;ing null byte (&#039;\0&#039;), to the buffer pointed to by dest.&nbsp; The strings may not&nbsp; over-<br />&nbsp; &nbsp; &nbsp; &nbsp;lap,&nbsp; and&nbsp; the&nbsp; destination&nbsp; string&nbsp; dest must be large enough to receive the copy.<br />&nbsp; &nbsp; &nbsp; &nbsp;Beware of buffer overruns!&nbsp; (See BUGS.)</p><p>&nbsp; &nbsp; &nbsp; &nbsp;The strncpy() function is similar, except that at most n bytes of src&nbsp; are&nbsp; copied.<br />&nbsp; &nbsp; &nbsp; &nbsp;Warning: If there is no null byte among the first n bytes of src, the string placed<br />&nbsp; &nbsp; &nbsp; &nbsp;in dest will not be null-terminated.</p><p>&nbsp; &nbsp; &nbsp; &nbsp;If the length of src is less than n, strncpy() writes additional null bytes to dest<br />&nbsp; &nbsp; &nbsp; &nbsp;to ensure that a total of n bytes are written.</p></div></div>]]></description>
			<author><![CDATA[null@example.com (drBatty)]]></author>
			<pubDate>Thu, 03 Oct 2013 11:49:14 +0000</pubDate>
			<guid>https://linuxforum.ru/viewtopic.php?pid=367199#p367199</guid>
		</item>
		<item>
			<title><![CDATA[Re: String и скобки]]></title>
			<link>https://linuxforum.ru/viewtopic.php?pid=367197#p367197</link>
			<description><![CDATA[<p>А на c++</p>]]></description>
			<author><![CDATA[null@example.com (viva_linuxoid)]]></author>
			<pubDate>Thu, 03 Oct 2013 11:46:49 +0000</pubDate>
			<guid>https://linuxforum.ru/viewtopic.php?pid=367197#p367197</guid>
		</item>
		<item>
			<title><![CDATA[Re: String и скобки]]></title>
			<link>https://linuxforum.ru/viewtopic.php?pid=367193#p367193</link>
			<description><![CDATA[<div class="quotebox"><cite>viva_linuxoid пишет:</cite><blockquote><p>А с библиотеками можно как-то создать строковую переменную в си ?</p></blockquote></div><p>нет.</p>]]></description>
			<author><![CDATA[null@example.com (drBatty)]]></author>
			<pubDate>Thu, 03 Oct 2013 11:41:15 +0000</pubDate>
			<guid>https://linuxforum.ru/viewtopic.php?pid=367193#p367193</guid>
		</item>
		<item>
			<title><![CDATA[Re: String и скобки]]></title>
			<link>https://linuxforum.ru/viewtopic.php?pid=367190#p367190</link>
			<description><![CDATA[<p>Хм...<br />А с библиотеками можно как-то создать строковую переменную в си ?</p>]]></description>
			<author><![CDATA[null@example.com (viva_linuxoid)]]></author>
			<pubDate>Thu, 03 Oct 2013 11:33:13 +0000</pubDate>
			<guid>https://linuxforum.ru/viewtopic.php?pid=367190#p367190</guid>
		</item>
		<item>
			<title><![CDATA[Re: String и скобки]]></title>
			<link>https://linuxforum.ru/viewtopic.php?pid=367184#p367184</link>
			<description><![CDATA[<div class="quotebox"><cite>viva_linuxoid пишет:</cite><blockquote><p>Я хотел спросить что дают скобки после имени метода</p></blockquote></div><p>1. Это <em>функция</em> называется. Методы в C++.<br />2. ничего не дают. Это просто синтаксис. В паскале вот пишут begin, end. В bash&#039;е пишут вот так:<br /></p><div class="codebox"><pre><code>case a in b
...
esac

if command; then
...
fi</code></pre></div><p>ну а в C <em>блок</em> (несколько операторов) отделяют скобками.</p><p>например<br /></p><div class="codebox"><pre><code>if(УСЛОВИЕ)
{
  ОПЕРАТОР1;
  ОПЕРАТОР2;
}</code></pre></div><p>оба оператора выполняются тогда, и только тогда, когда УСЛОВИЕ истинно (т.е. не равно нулю в C).<br /></p><div class="quotebox"><cite>viva_linuxoid пишет:</cite><blockquote><p>как создать переменную string в си</p></blockquote></div><p>никак.</p><p>Можно только сделать массив из символов.</p><div class="codebox"><pre><code>const char str[] = &quot;test string&quot;;</code></pre></div><p>такой массив имеет тип <strong>char*</strong>, оканчивается символом \0, и его нельзя менять.</p><p>Можно сделать массивы и так, что-бы их содержимое можно было менять (но не размер)<br /></p><div class="codebox"><pre><code>char str2[256];</code></pre></div><p>PS: сейчас набегут тролли, и скажут, что размер менять можно. Я знаю. В новом стандарте иногда можно. Но не нужно.</p><p>PPS: да, ещё можно выделить память функцией malloc(3) и потом удалить free(3).</p><p>PPPS: сейчас набигут... Короче, если кто набижать хочет -- лучше расскажите сами.</p>]]></description>
			<author><![CDATA[null@example.com (drBatty)]]></author>
			<pubDate>Thu, 03 Oct 2013 11:26:11 +0000</pubDate>
			<guid>https://linuxforum.ru/viewtopic.php?pid=367184#p367184</guid>
		</item>
		<item>
			<title><![CDATA[String и скобки]]></title>
			<link>https://linuxforum.ru/viewtopic.php?pid=367176#p367176</link>
			<description><![CDATA[<p><strong><em>доброго времени и суток !!!</em></strong><br />Я хотел спросить что дают скобки после имени метода и как создать переменную string в си (чистом си).<br />заранее спасибо.<br />(давно мучают эти вопросы)</p>]]></description>
			<author><![CDATA[null@example.com (viva_linuxoid)]]></author>
			<pubDate>Thu, 03 Oct 2013 10:30:18 +0000</pubDate>
			<guid>https://linuxforum.ru/viewtopic.php?pid=367176#p367176</guid>
		</item>
	</channel>
</rss>
