<?xml version="1.0" encoding="windows-1251"?>

<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
	<channel>
		<title>Форум программистов - Общие вопросы C/C++</title>
		<link>http://www.programmersforum.ru/</link>
		<description />
		<language>ru</language>
		<lastBuildDate>Sat, 04 Sep 2010 01:25:38 GMT</lastBuildDate>
		<generator>vBulletin</generator>
		<ttl>10</ttl>
		<image>
			<url>http://programmersforum.ru/images/1070/misc/rss.jpg</url>
			<title>Форум программистов - Общие вопросы C/C++</title>
			<link>http://www.programmersforum.ru/</link>
		</image>
		<item>
			<title>qsort - Segmentation fault и другие непонятки</title>
			<link>http://www.programmersforum.ru/showthread.php?t=112115&amp;goto=newpost</link>
			<pubDate>Fri, 03 Sep 2010 20:22:12 GMT</pubDate>
			<description>Здравствуйте, прошу помощи. Темы по quicksort на форуме не просветили. 
Мой компилятор GNU cpp-4.4 
Мой главный вопрос: как в функцию передается...</description>
			<content:encoded><![CDATA[<div>Здравствуйте, прошу помощи. Темы по quicksort на форуме не просветили.<br />
Мой компилятор GNU cpp-4.4<br />
Мой главный вопрос: как в функцию передается массив?<br />
Страуструп не помог:<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Код:</div>
	<hr /><code style="margin:0px" dir="ltr" style="text-align:left">(Если в качестве параметра функции указан массив, то передается указатель на его первый элемент.<br />
Например:<br />
int strlen(const char*);<br />
void f()<br />
{<br />
char v[] = &quot;массив&quot;;<br />
strlen(v);<br />
strlen(&quot;Николай&quot;);<br />
}<br />
Это означает, что фактический параметр типа T[] преобразуется к типу T*, и затем передается)</code><hr />
</div>Моя реализация quicksort выдает ошибку &quot;Segmentation fault&quot;:<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Код:</div>
	<hr /><code style="margin:0px" dir="ltr" style="text-align:left">#include &lt;iostream&gt;<br />
using namespace std;<br />
<br />
int qsort(long line[], long left, long right){<br />
&nbsp; &nbsp; &nbsp; &nbsp; if (left &gt;= right){return 0;}<br />
&nbsp; &nbsp; &nbsp; &nbsp; long left_const = left;<br />
&nbsp; &nbsp; &nbsp; &nbsp; long right_const = right;<br />
&nbsp; &nbsp; &nbsp; &nbsp; long sample = line[(left + right) / 2];<br />
&nbsp; &nbsp; &nbsp; &nbsp; while (left &lt;= right){<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; while (line[left] &lt; sample){left++;}<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; while (line[right] &gt; sample){right--;}<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (left &lt;= right){<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; long temp = line[left];<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; line[left] = line[right];<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; line[right] = temp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; qsort(line, left_const, right);<br />
&nbsp; &nbsp; &nbsp; &nbsp; qsort(line, left, right_const);<br />
&nbsp; &nbsp; &nbsp; &nbsp; }<br />
}<br />
<br />
int main(){<br />
&nbsp; &nbsp; &nbsp; &nbsp; long N = 0; cin &gt;&gt; N; long i = 0;<br />
&nbsp; &nbsp; &nbsp; &nbsp; long array[N];<br />
&nbsp; &nbsp; &nbsp; &nbsp; while (i &lt; N){cin &gt;&gt; array[i]; i++;}<br />
&nbsp; &nbsp; &nbsp; &nbsp; qsort(array, 0, N - 1);<br />
&nbsp; &nbsp; &nbsp; &nbsp; i = 0;<br />
&nbsp; &nbsp; &nbsp; &nbsp; while (i &lt; N){cout &lt;&lt; array[i];}<br />
&nbsp; &nbsp; &nbsp; &nbsp; cout &lt;&lt; endl;<br />
&nbsp; &nbsp; &nbsp; &nbsp; return 0;<br />
}</code><hr />
</div>Параллельный вопрос: в какой библиотеке искать функцию типа random.randint(start, stop), а то всегда делить пополам плачевно (мне показалось, что в Страуструпе нет)<br />
<br />
Факультативные вопросы:<br />
1)какой смысл несет строка<br />
using namespace std;<br />
и почему без нее ничего не работает?<br />
2) почему в некоторых учебниках в примерах подключается библиотека &lt;iostream.h&gt;, а в остальных &lt;iostream&gt;, причем первый вариант у меня не работает?<br />
<br />
надеюсь, что выразился внятно, заранее спасибо.</div>

]]></content:encoded>
			<category domain="http://www.programmersforum.ru/forumdisplay.php?f=14">Общие вопросы C/C++</category>
			<dc:creator>FILLIPO</dc:creator>
			<guid isPermaLink="true">http://www.programmersforum.ru/showthread.php?t=112115</guid>
		</item>
		<item>
			<title>Функция strcmp()</title>
			<link>http://www.programmersforum.ru/showthread.php?t=112110&amp;goto=newpost</link>
			<pubDate>Fri, 03 Sep 2010 19:35:04 GMT</pubDate>
			<description>Функция Strcmp() сравнивает строку s2 со строкой s1.Если строка s1 лексикографически меньше строки  s2,возращает отрицательное число. 
 
В смысле...</description>
			<content:encoded><![CDATA[<div>Функция Strcmp() сравнивает строку s2 со строкой s1.Если строка s1 лексикографически меньше строки  s2,возращает отрицательное число.<br />
<br />
В смысле каждый раз любое произвольное отрицательное число?или определенное?</div>

]]></content:encoded>
			<category domain="http://www.programmersforum.ru/forumdisplay.php?f=14">Общие вопросы C/C++</category>
			<dc:creator>ts-alan</dc:creator>
			<guid isPermaLink="true">http://www.programmersforum.ru/showthread.php?t=112110</guid>
		</item>
		<item>
			<title>Первое приложение на WinAPI</title>
			<link>http://www.programmersforum.ru/showthread.php?t=112101&amp;goto=newpost</link>
			<pubDate>Fri, 03 Sep 2010 17:25:46 GMT</pubDate>
			<description>Всем привет. Написал по методичке код программы, даже сверил его с кодом при создании обычного решения. В итоге окно просто не появляется при...</description>
			<content:encoded><![CDATA[<div>Всем привет. Написал по методичке код программы, даже сверил его с кодом при создании обычного решения. В итоге окно просто не появляется при запуске. Вот код:<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Код:</div>
	<hr /><code style="margin:0px" dir="ltr" style="text-align:left">#include &lt;windows.h&gt;<br />
<br />
wchar_t szClassName[]=L&quot;MainWindow&quot;;<br />
wchar_t szTitle[]=L&quot;Программа 1-1&quot;;<br />
LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam);<br />
BOOL InitInstance(HINSTANCE hInstance, int nCmdShow);<br />
<br />
void MyRegisterClass(HINSTANCE hInstance)<br />
{<br />
&nbsp; &nbsp; &nbsp; &nbsp; WNDCLASS w;<br />
&nbsp; &nbsp; &nbsp; &nbsp; memset( &amp;w, 0, sizeof (WNDCLASS) );<br />
&nbsp; &nbsp; &nbsp; &nbsp; w.style&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = CS_HREDRAW | CS_VREDRAW;<br />
&nbsp; &nbsp; &nbsp; &nbsp; w.lpfnWndProc&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = WndProc;<br />
&nbsp; &nbsp; &nbsp; &nbsp; w.hInstance&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = hInstance;<br />
&nbsp; &nbsp; &nbsp; &nbsp; w.hbrBackground&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = (HBRUSH)GetStockObject(WHITE_BRUSH);<br />
&nbsp; &nbsp; &nbsp; &nbsp; w.lpszClassName&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = L&quot;MyClass&quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; w.hIcon&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  = LoadIcon(NULL, IDI_APPLICATION);<br />
&nbsp; &nbsp; &nbsp; &nbsp; w.hCursor&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = LoadCursor(NULL,IDC_IBEAM);<br />
&nbsp; &nbsp; &nbsp; &nbsp; RegisterClass(&amp;w);<br />
}<br />
<br />
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)<br />
{<br />
&nbsp; &nbsp; &nbsp; &nbsp; MSG msg;<br />
&nbsp; &nbsp; &nbsp; &nbsp; MyRegisterClass(hInstance);<br />
&nbsp; &nbsp; &nbsp; &nbsp; if (!InitInstance (hInstance, nCmdShow))<br />
&nbsp; &nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return FALSE;<br />
&nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; while (GetMessage(&amp;msg, NULL, 0, 0))<br />
&nbsp; &nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; TranslateMessage(&amp;msg);<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; DispatchMessage(&amp;msg);<br />
&nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; return (int) msg.wParam;<br />
}<br />
<br />
LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) <br />
{<br />
&nbsp; &nbsp; &nbsp; &nbsp; switch(message) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; case WM_DESTROY:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; PostQuitMessage(0);<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return 0;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; default:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return DefWindowProc(hwnd,message,wParam,lParam);<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />
}<br />
<br />
BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)<br />
{<br />
&nbsp;  HWND hWnd;<br />
<br />
&nbsp;  //hInst = hInstance; // Сохранить дескриптор экземпляра в глобальной переменной<br />
<br />
&nbsp;  hWnd = CreateWindow(szClassName, szTitle, WS_OVERLAPPEDWINDOW,<br />
&nbsp; &nbsp; &nbsp; CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, NULL, NULL, hInstance, NULL);<br />
<br />
&nbsp;  if (!hWnd)<br />
&nbsp;  {<br />
&nbsp; &nbsp; &nbsp; return FALSE;<br />
&nbsp;  }<br />
<br />
&nbsp;  ShowWindow(hWnd, nCmdShow);<br />
&nbsp;  UpdateWindow(hWnd);<br />
<br />
&nbsp;  return TRUE;<br />
}</code><hr />
</div></div>

]]></content:encoded>
			<category domain="http://www.programmersforum.ru/forumdisplay.php?f=14">Общие вопросы C/C++</category>
			<dc:creator>m9yt</dc:creator>
			<guid isPermaLink="true">http://www.programmersforum.ru/showthread.php?t=112101</guid>
		</item>
		<item>
			<title>Qt-creator опции компилятора</title>
			<link>http://www.programmersforum.ru/showthread.php?t=112095&amp;goto=newpost</link>
			<pubDate>Fri, 03 Sep 2010 16:49:04 GMT</pubDate>
			<description><![CDATA[У меня есть класс( class.cpp, class.h ), файл main.cpp: 
 
Код: 
--------- 
#include "server.h" 
 
Class OBJ( "param" ); 
 
int main() 
{]]></description>
			<content:encoded><![CDATA[<div>У меня есть класс( class.cpp, class.h ), файл main.cpp:<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Код:</div>
	<hr /><code style="margin:0px" dir="ltr" style="text-align:left">#include &quot;server.h&quot;<br />
<br />
Class OBJ( &quot;param&quot; );<br />
<br />
int main()<br />
{<br />
&nbsp; &nbsp; OBJ.Collect();<br />
&nbsp; &nbsp; OBJ.launch();<br />
}<br />
<br />
#include &quot;myfiles/test.cpp&quot;</code><hr />
</div>а test.cpp будет содержать функцию extern &quot;C&quot; void _test(), которую попытается с помощью dlsym( NULL, &quot;test&quot; ) найти еще одна функция в файле class.cpp в методе launch(). Весь проэкт надо собрать с опциями -ldl и -rdynamic, чтобы dlsym работал. Как это настроить в qt-creator?</div>

]]></content:encoded>
			<category domain="http://www.programmersforum.ru/forumdisplay.php?f=14">Общие вопросы C/C++</category>
			<dc:creator>nowaalex</dc:creator>
			<guid isPermaLink="true">http://www.programmersforum.ru/showthread.php?t=112095</guid>
		</item>
		<item>
			<title>Нужно сделать простую программу со стеками</title>
			<link>http://www.programmersforum.ru/showthread.php?t=112092&amp;goto=newpost</link>
			<pubDate>Fri, 03 Sep 2010 15:51:18 GMT</pubDate>
			<description>Мне нужно перевести фамилию художника в название его работы используя очередь (типа используя макросы). 
 
Я в С++ вообще не розбираюсь. Кто-то может...</description>
			<content:encoded><![CDATA[<div>Мне нужно перевести фамилию художника в название его работы используя очередь (типа используя макросы).<br />
<br />
Я в С++ вообще не розбираюсь. Кто-то может помочь?</div>

]]></content:encoded>
			<category domain="http://www.programmersforum.ru/forumdisplay.php?f=14">Общие вопросы C/C++</category>
			<dc:creator>Photoshopper</dc:creator>
			<guid isPermaLink="true">http://www.programmersforum.ru/showthread.php?t=112092</guid>
		</item>
		<item>
			<title>найти ошибку</title>
			<link>http://www.programmersforum.ru/showthread.php?t=112089&amp;goto=newpost</link>
			<pubDate>Fri, 03 Sep 2010 15:09:09 GMT</pubDate>
			<description>Дана задача: 
Для данной буквы латинского алфавита нужно вывести справа стоящую букву на стандартной клавиатуре. При этом клавиатура замкнута, т.е....</description>
			<content:encoded><![CDATA[<div>Дана задача:<br />
Для данной буквы латинского алфавита нужно вывести справа стоящую букву на стандартной клавиатуре. При этом клавиатура замкнута, т.е. справа от буквы «p» стоит буква «a», от буквы «l» стоит буква «z», а от буквы «m» — буква «q».<br />
<br />
Написал решение, но при q выводит М. Объясните почему?<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Код:</div>
	<hr /><code style="margin:0px" dir="ltr" style="text-align:left">#include &quot;stdafx.h&quot;<br />
#include &lt;iostream&gt;<br />
#include &lt;fstream&gt;<br />
#include &lt;iomanip&gt;<br />
using namespace std;<br />
<br />
int main()<br />
{&nbsp; &nbsp; &nbsp; &nbsp; int i;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  <br />
&nbsp; &nbsp; &nbsp; &nbsp; char r[1],m[1], n[28]=&quot;qwertyuiopasdfghjklzxcvbnmq&quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; ifstream f;<br />
&nbsp; &nbsp; &nbsp; &nbsp; f.open(&quot;input.txt&quot;);<br />
&nbsp; &nbsp; &nbsp; &nbsp; f&gt;&gt;m[1];<br />
&nbsp; &nbsp; &nbsp; &nbsp; ofstream s;<br />
&nbsp; &nbsp; &nbsp; &nbsp; s.open(&quot;output.txt&quot;);<br />
&nbsp; &nbsp; &nbsp; &nbsp; for (i=1;i&lt;=26;i++)<br />
&nbsp; &nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (n[i]==m[1]) <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; r[1]=n[i+1];<br />
&nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; s&lt;&lt;r[1];<br />
&nbsp; &nbsp; &nbsp; &nbsp; f.close();<br />
&nbsp; &nbsp; &nbsp; &nbsp; s.close();<br />
&nbsp; &nbsp; &nbsp; &nbsp; return 0;<br />
}</code><hr />
</div></div>

]]></content:encoded>
			<category domain="http://www.programmersforum.ru/forumdisplay.php?f=14">Общие вопросы C/C++</category>
			<dc:creator>sergio11</dc:creator>
			<guid isPermaLink="true">http://www.programmersforum.ru/showthread.php?t=112089</guid>
		</item>
		<item>
			<title>QT, QTreeWidget</title>
			<link>http://www.programmersforum.ru/showthread.php?t=112044&amp;goto=newpost</link>
			<pubDate>Fri, 03 Sep 2010 07:52:46 GMT</pubDate>
			<description>здравствуйте, у меня есть QTreeWidget, из таблички я должна переместить туда элементы. такой вопрос, как добавлять дочернии и создавать родительские...</description>
			<content:encoded><![CDATA[<div>здравствуйте, у меня есть QTreeWidget, из таблички я должна переместить туда элементы. такой вопрос, как добавлять дочернии и создавать родительские узлы? можете привести пример? заранее благодарна</div>

]]></content:encoded>
			<category domain="http://www.programmersforum.ru/forumdisplay.php?f=14">Общие вопросы C/C++</category>
			<dc:creator>vamp8</dc:creator>
			<guid isPermaLink="true">http://www.programmersforum.ru/showthread.php?t=112044</guid>
		</item>
		<item>
			<title>int vs size_t on 64-bit systems</title>
			<link>http://www.programmersforum.ru/showthread.php?t=112020&amp;goto=newpost</link>
			<pubDate>Thu, 02 Sep 2010 20:16:05 GMT</pubDate>
			<description>привет. 
имею слудеющую проблему 
 
 
Код: 
--------- 
char *ch_codepage(char *codepage, char *text, int *len) { 
	int one = 1; 
	static char...</description>
			<content:encoded><![CDATA[<div>привет.<br />
имею слудеющую проблему<br />
<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Код:</div>
	<hr /><code style="margin:0px" dir="ltr" style="text-align:left">char *ch_codepage(char *codepage, char *text, int *len) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; int one = 1;<br />
&nbsp; &nbsp; &nbsp; &nbsp; static char buf[2048];<br />
&nbsp; &nbsp; &nbsp; &nbsp; char my_result[2048]=&quot;&quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; const char *msghold = text;<br />
&nbsp; &nbsp; &nbsp; &nbsp; char *res = my_result, *holder = &amp;buf[0];<br />
&nbsp; &nbsp; &nbsp; &nbsp; size_t outsize, r;<br />
&nbsp; &nbsp; &nbsp; &nbsp; iconv_t cd;<br />
&nbsp; &nbsp; &nbsp; &nbsp; char ignore_codepage[40];<br />
&nbsp; &nbsp; &nbsp; &nbsp; strncpy(ignore_codepage, codepage, 39);<br />
&nbsp; &nbsp; &nbsp; &nbsp; strncat(ignore_codepage, &quot;//IGNORE&quot;, 39 - strlen(codepage));<br />
&nbsp; &nbsp; &nbsp; &nbsp; cd = iconv_open(ignore_codepage, DEF_CODEPAGE);<br />
&nbsp; &nbsp; &nbsp; &nbsp; if (cd == (iconv_t)(-1)) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return text;<br />
&nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; outsize = 2048;<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; r = iconv (cd,(char **) &amp;msghold, len, &amp;holder, &amp;outsize);<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; if (r &lt; 0 || (*len) != 0) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; iconv_close (cd);<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return text;<br />
&nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; *len = 2048 - outsize;<br />
&nbsp; &nbsp; &nbsp; &nbsp; buf[*len] = 0;<br />
&nbsp; &nbsp; &nbsp; &nbsp; iconv_close (cd);<br />
&nbsp; &nbsp; &nbsp; &nbsp; return &amp;buf[0];<br />
}</code><hr />
</div>в данном коде, <br />
r = iconv (cd,(char **) &amp;msghold, len, &amp;holder, &amp;outsize);<br />
len  - тип int, но iconv подразумевает, что там будет передан тип size_t<br />
<br />
extern size_t iconv (iconv_t __cd, char **__restrict __inbuf,<br />
		     size_t *__restrict __inbytesleft,<br />
		     size_t *__restrict __outbytesleft);<br />
<br />
на 32 битных системах оно работает нормально. на 64 битах имеем сегментейшен фоулт. как я понимаю из-за неверного представления о размере size_t.<br />
<br />
подскажите пожалуйста, как заставить это дело работать на 64 бит.</div>

]]></content:encoded>
			<category domain="http://www.programmersforum.ru/forumdisplay.php?f=14">Общие вопросы C/C++</category>
			<dc:creator>lameroid</dc:creator>
			<guid isPermaLink="true">http://www.programmersforum.ru/showthread.php?t=112020</guid>
		</item>
		<item>
			<title>ld и классы</title>
			<link>http://www.programmersforum.ru/showthread.php?t=112009&amp;goto=newpost</link>
			<pubDate>Thu, 02 Sep 2010 17:06:32 GMT</pubDate>
			<description><![CDATA[Имеется некий класс( 2 файла, class.h и class.cpp ). 
В файле test.cpp содержание примерно такое: 
 
 
Код: 
--------- 
#include <class.h> 
 
Class...]]></description>
			<content:encoded><![CDATA[<div>Имеется некий класс( 2 файла, class.h и class.cpp ).<br />
В файле test.cpp содержание примерно такое:<br />
<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Код:</div>
	<hr /><code style="margin:0px" dir="ltr" style="text-align:left">#include &lt;class.h&gt;<br />
<br />
Class Object;<br />
Object.Method();</code><hr />
</div>Нужно из файла test.cpp сделать динамическую библиотеку, чтобы она подключалась с помощью dlopen/dlsym. Пока на такой код ругается<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Код:</div>
	<hr /><code style="margin:0px" dir="ltr" style="text-align:left">undefined symbol: _ZN6ServerD1Ev</code><hr />
</div>любые идеи приветствуются)</div>

]]></content:encoded>
			<category domain="http://www.programmersforum.ru/forumdisplay.php?f=14">Общие вопросы C/C++</category>
			<dc:creator>nowaalex</dc:creator>
			<guid isPermaLink="true">http://www.programmersforum.ru/showthread.php?t=112009</guid>
		</item>
		<item>
			<title>Ошибки при линковке.</title>
			<link>http://www.programmersforum.ru/showthread.php?t=112006&amp;goto=newpost</link>
			<pubDate>Thu, 02 Sep 2010 16:40:48 GMT</pubDate>
			<description>Мой код:   
 
Figure.h 
//--------------------------------------------------------------------------- 
 
#ifndef FIGURE_H 
#define FIGURE_H 
#include...</description>
			<content:encoded><![CDATA[<div>Мой код:  <br />
<br />
Figure.h<br />
//---------------------------------------------------------------------------<br />
<br />
#ifndef FIGURE_H<br />
#define FIGURE_H<br />
#include &lt;stdlib.h&gt;<br />
#define MaxSize 553<br />
//---------------------------------------------------------------------------<br />
<br />
class Figure   {                        // Абстрактный класс<br />
   public:<br />
      Figure();<br />
      virtual ~Figure()  {              // Деструктор. ОБЯЗАТЕЛЬНО должен быть виртуальным у полиморфных <br />
      }                                 // (использующих виртуальные функции) классов<br />
<br />
      virtual void setLine();<br />
      virtual void Draw() const = 0;   //Обьявлена чистая виртуальная функция<br />
<br />
      void getX()   {                   // Получение координаты x<br />
         x=random(MaxSize);<br />
      };<br />
<br />
      void getY()    {                  // Получение координаты y<br />
         y=random(MaxSize);<br />
      };<br />
<br />
   protected:<br />
      int x;<br />
      int y;<br />
      TPoint p[10];<br />
};<br />
<br />
<br />
class Line: public Figure   {<br />
   public:<br />
      Line()   {                             // Конструктор<br />
         for (int i=0; i&lt;2; ++i)   {<br />
            p[i].x=-1;                       // По умолчанию коордтнатам присваивается значение -1<br />
            p[i].y=-1;<br />
         }<br />
      };<br />
      void setLine() {<br />
         for (int i=0; i&lt;2; ++i) {<br />
            Line::getX();<br />
            p[i].x=x;<br />
            Line::getY();<br />
            p[i].y=y;<br />
         }<br />
      };<br />
      void Draw() const;            // Рисование фигуры<br />
   protected:<br />
      int x;<br />
      int y;<br />
      TPoint p[2];<br />
};<br />
//---------------------------------------------------------------------------<br />
#endif<br />
<br />
<br />
<br />
Figure.cpp<br />
//---------------------------------------------------------------------------<br />
#include &lt;vcl.h&gt;<br />
#pragma hdrstop<br />
<br />
#include &quot;Figure.h&quot;<br />
#include &quot;Unit1.h&quot;<br />
#pragma package(smart_init)<br />
//---------------------------------------------------------------------------<br />
//  class Line<br />
//---------------------------------------------------------------------------<br />
<br />
void Line::Draw()  const   {<br />
  Form1-&gt;PaintBox1-&gt;Canvas-&gt;Polyline(p,2);<br />
}<br />
<br />
<br />
Unit1.cpp<br />
<br />
//---------------------------------------------------------------------------<br />
#include &lt;vcl.h&gt;<br />
#pragma hdrstop<br />
#include &quot;Unit1.h&quot;<br />
<br />
//---------------------------------------------------------------------------<br />
#pragma package(smart_init)<br />
#pragma resource &quot;*.dfm&quot;<br />
<br />
TForm1 *Form1;<br />
//---------------------------------------------------------------------------<br />
__fastcall TForm1::TForm1(TComponent* Owner)<br />
   : TForm(Owner)<br />
{<br />
<br />
}<br />
//---------------------------------------------------------------------------<br />
<br />
#include &lt;stdio.h&gt;<br />
#include &lt;iostream.h&gt;<br />
#define MaxSize 553<br />
<br />
void __fastcall TForm1::Button1Click(TObject *Sender)   {<br />
   Line O=Line();<br />
   O.Draw();<br />
}<br />
<br />
void __fastcall TForm1::Button2Click(TObject *Sender)<br />
{<br />
      Form1-&gt;Close();<br />
}<br />
//---------------------------------------------------------------------------<br />
<br />
В Unit.h Figure.h добавлен.<br />
<br />
<br />
Ошибки при линковке:<br />
[Linker Error] Unresolved external 'Figure::setLine()' referenced from F:\НОВАЯ ПАПКА\UNIT1.OBJ<br />
[Linker Error] Unresolved external 'Figure::Figure()' referenced from F:\НОВАЯ ПАПКА\UNIT1.OBJ<br />
<br />
Что необходимо подключить для разрешений ошибок?</div>

]]></content:encoded>
			<category domain="http://www.programmersforum.ru/forumdisplay.php?f=14">Общие вопросы C/C++</category>
			<dc:creator>ТриСемёрки</dc:creator>
			<guid isPermaLink="true">http://www.programmersforum.ru/showthread.php?t=112006</guid>
		</item>
		<item>
			<title><![CDATA[if (fileinfo->attrib==????) и удаление файла]]></title>
			<link>http://www.programmersforum.ru/showthread.php?t=111975&amp;goto=newpost</link>
			<pubDate>Thu, 02 Sep 2010 12:13:45 GMT</pubDate>
			<description>Надо в программке  сделать проверку атрибута. В том случае, если у  файла (каталога) установлен атрибут Read-Only, необходимо его удалить. 
Написала...</description>
			<content:encoded><![CDATA[<div>Надо в программке  сделать проверку атрибута. В том случае, если у  файла (каталога) установлен атрибут Read-Only, необходимо его удалить.<br />
Написала код:<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Код:</div>
	<hr /><code style="margin:0px" dir="ltr" style="text-align:left">void Dell()&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
{<br />
&nbsp; &nbsp; &nbsp; &nbsp; char path[70];<br />
&nbsp; &nbsp; &nbsp; &nbsp; cout &lt;&lt; &quot;\nEnter full path (for example, C:\\*.*):&quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; cin &gt;&gt; path;<br />
&nbsp; &nbsp; &nbsp; &nbsp; _finddata_t *fileinfo=new _finddata_t;&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; long done = _findfirst(path,fileinfo);<br />
&nbsp; &nbsp; &nbsp; &nbsp; int MayWeWork = done;&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; int count = 0;&nbsp;  <br />
&nbsp; &nbsp; &nbsp; &nbsp; while (MayWeWork!=-1)<br />
&nbsp; &nbsp; &nbsp; &nbsp; {&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (fileinfo-&gt;attrib==?????????????????)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ????????????????????<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; count++;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cout &lt;&lt; fileinfo-&gt;name &lt;&lt; &quot;\n\n&quot;; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MayWeWork = _findnext(done, fileinfo);&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; // Вывод сообщения о количестве найденных файлов.<br />
&nbsp; &nbsp; &nbsp; &nbsp; cout &lt;&lt; &quot;\nInformation: was found &quot; &lt;&lt; count;<br />
&nbsp; &nbsp; &nbsp; &nbsp; cout &lt;&lt; &quot; file(s) in folder...&quot; &lt;&lt; path &lt;&lt; &quot;\n\n&quot;;<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; // Очистка памяти<br />
&nbsp; &nbsp; &nbsp; &nbsp; _findclose(done);<br />
&nbsp; &nbsp; &nbsp; &nbsp; delete fileinfo;<br />
}</code><hr />
</div>Подскажите пожалуйста что нужно писать в строчке if (fileinfo-&gt;attrib==????) - чтобы проверить имеет ли заданный файл атрибут Read-Only и как его удалить<br />
		{<br />
			????????????????????<br />
		}</div>

]]></content:encoded>
			<category domain="http://www.programmersforum.ru/forumdisplay.php?f=14">Общие вопросы C/C++</category>
			<dc:creator>Alena-b-v</dc:creator>
			<guid isPermaLink="true">http://www.programmersforum.ru/showthread.php?t=111975</guid>
		</item>
		<item>
			<title>Геометрическая задача</title>
			<link>http://www.programmersforum.ru/showthread.php?t=111971&amp;goto=newpost</link>
			<pubDate>Thu, 02 Sep 2010 11:20:16 GMT</pubDate>
			<description>Доброго времени суток! 
 Это опять я, и опять с вопросом по поводу задачи. 
 
 Не могу понять как решить задачу... Кто может, помогите разобраться...</description>
			<content:encoded><![CDATA[<div>Доброго времени суток!<br />
 Это опять я, и опять с вопросом по поводу задачи.<br />
<br />
 Не могу понять как решить задачу... Кто может, помогите разобраться что нужно сделать. Задача такова:<br />
<br />
Две деревни A и B находятся, соответственно, на расстояниях a, b от газовой магистрали и удалены друг от друга на расстояние d. Для из газификации требуется построить газораспределительный пункт на магистрали и соединить его газопроводами с деревнями. Составить программу поиска такого расположения газораспределительного пункта магистрали, чтобы суммарная длина газопроводов была наименьшей. Рассмотреть два случая: <br />
а) села находятся по одну сторону от магистрали;<br />
б) села находятся по разные стороны от магистрали.<br />
<br />
<br />
Текст программы-решения мне не нужен, просто помогите разобраться с алгоритмом решения пожалуйста.</div>

]]></content:encoded>
			<category domain="http://www.programmersforum.ru/forumdisplay.php?f=14">Общие вопросы C/C++</category>
			<dc:creator>HackNick</dc:creator>
			<guid isPermaLink="true">http://www.programmersforum.ru/showthread.php?t=111971</guid>
		</item>
		<item>
			<title>VSTi SDK Steinberg. Имел ли кто дело с этим?</title>
			<link>http://www.programmersforum.ru/showthread.php?t=111950&amp;goto=newpost</link>
			<pubDate>Thu, 02 Sep 2010 09:04:57 GMT</pubDate>
			<description>Здравствуйте, имел ли кто дело с плагинописанием под музыкальные хосты типа Cubase, FL? Плагины в формате VST, (*.dll). Очень интересно поговорить с...</description>
			<content:encoded><![CDATA[<div>Здравствуйте, имел ли кто дело с плагинописанием под музыкальные хосты типа Cubase, FL? Плагины в формате VST, (*.dll). Очень интересно поговорить с людьми, которые хоть немного разбираются. Лично я знаю лишь основы C++, на машине установлена VC++ 2008. Скачал с оф сайта freeware SDK Steinberg для написания VST. Там присутствует полная документация, библиотека классов и исходники. И даже исходники у меня почему то не работают, выдаёт ошибку при компиляции. Может быть я SDK не так воткнул? Да и если бы я всё правильно воткнул, всё равно у меня бы ничего не вышло. Меня очень интересует C++. Хочу научиться программировать на нём. Я не гонюсь за престижем или заработком, я просто хочу и жажду писать на C++. Я заблудился в тонне информации и не знаю в какую сторону пойти, чтобы не сбиться. Интересует прикладное программирование на C++. Так же хочется научиться математике через программирование, потому как преподаватели плохо объясняют, в книгах тоже ничерта не понять бывает. А если б эта математика была в форме алгоритма - было бы понятнее.. и заодно двух зайцев так можно убить - обучиться программированию и математику понять. Что мне делать? Что читать? Эх..<br />
PS не называть школьником или халявщиком, я настроен серьёзно и готов к трудностям. Только я не вижу куда идти, осветите путь)</div>

]]></content:encoded>
			<category domain="http://www.programmersforum.ru/forumdisplay.php?f=14">Общие вопросы C/C++</category>
			<dc:creator>MusicManager</dc:creator>
			<guid isPermaLink="true">http://www.programmersforum.ru/showthread.php?t=111950</guid>
		</item>
		<item>
			<title><![CDATA[system("pause") для C#]]></title>
			<link>http://www.programmersforum.ru/showthread.php?t=111923&amp;goto=newpost</link>
			<pubDate>Wed, 01 Sep 2010 19:25:13 GMT</pubDate>
			<description><![CDATA[Есть ли аналог system("pause") для c# или другой оператор который не позволяет окну закрыться после выполнения программы?]]></description>
			<content:encoded><![CDATA[<div>Есть ли аналог system(&quot;pause&quot;) для c# или другой оператор который не позволяет окну закрыться после выполнения программы?</div>

]]></content:encoded>
			<category domain="http://www.programmersforum.ru/forumdisplay.php?f=14">Общие вопросы C/C++</category>
			<dc:creator>MrJenika</dc:creator>
			<guid isPermaLink="true">http://www.programmersforum.ru/showthread.php?t=111923</guid>
		</item>
		<item>
			<title>Константы с U, L и F</title>
			<link>http://www.programmersforum.ru/showthread.php?t=111917&amp;goto=newpost</link>
			<pubDate>Wed, 01 Sep 2010 17:57:50 GMT</pubDate>
			<description>Всем добрый вечер! 
Объясните пожалуйста, в чём практическая польза от использования U и L на конце константы, с F всё понятно - экономия памяти так...</description>
			<content:encoded><![CDATA[<div>Всем добрый вечер!<br />
Объясните пожалуйста, в чём практическая польза от использования U и L на конце константы, с F всё понятно - экономия памяти так как вещественные константы представляются типом double, а вот с целочисленными что-то не ясно, тем более что long int и int в 32-разрядных ОС занимают одинаковое количество памяти. Буду благодарен за ответ.</div>

]]></content:encoded>
			<category domain="http://www.programmersforum.ru/forumdisplay.php?f=14">Общие вопросы C/C++</category>
			<dc:creator>Smarti</dc:creator>
			<guid isPermaLink="true">http://www.programmersforum.ru/showthread.php?t=111917</guid>
		</item>
	</channel>
</rss>
