ALT Linux Community general discussions
 help / color / mirror / Atom feed
From: "Egor Azanov" <kr0n@mail.ru>
To: mandrake-russian@altlinux.ru
Subject: Re: [mdk-re] C/C++ question
Date: Mon Apr 30 14:28:11 2001
Message-ID: <E14uAxT-000JQz-00@f11.mail.ru> (raw)
In-Reply-To: <20010430101146.AD9A76AC@ser-linux.ffyud>

>Здравствуйте!
>
>Это звучит немножко оффтопик, но хочется посоветоваться.
>
>В одной программе на "двухкрестовом" столкнулся со строчкой,
>наподобие следующего отрывка:
>
>char		buf[BUFSIZ];
>// ...
>if ( buf[0] == '\n' || buf[0] == '<cr>' )
>                       ^^^^^^^^^^^^^^^^
>{
>   // ...
>}
>
>Ни я, ни компилятор этого места не поняли. Компилятору проще, он
>пожаловасля на то, что вовремя не нашел парный ':). А я вообще
>теряюсь в загадках. Я понимаю, что можно (в С) инициализировать
>int с помощью двух символов, но можно ли так инициализировать
>32-битный int? И на какой же интеллект компилятора все это
>рассчитано, если предполагается, что надо разыменованый указатель
>на char привести к разыменованному указателю на int только
>потому, что в правой части оператора сравнения имеется символьный
>литерал, который имеет смысл только для инициализации 32-битного
>целого? Я из виндового мира, может, чего не понимаю? Просветите,
>у кого есть время и молоко:)
>
>Второй вопрос "чисто конкретный":) поиск по '<cr>' никак не идет
>ни в nedit, ни в mc. Про спецсимволы вроде читал, но чего-то не
>понимаю, как надо все оформить, чтобы стало искать именно такой
>образец?
>
Насколько я понял, требуется найти LF (он же \n) и CR (он же не <cr>, а \r). Поэтому и искать надо символ '\r'.

--
Egor Azanov
UIN: 88947344
<kr0n@mail.ru>



  reply	other threads:[~2001-04-30 14:28 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-04-30 14:09 Serge Skorokhodov
2001-04-30 14:28 ` Egor Azanov [this message]
2001-04-30 18:27   ` Serge Skorokhodov
2001-04-30 17:51 ` Andrei Gerasimenko
2001-04-30 20:28   ` Serge Skorokhodov
2001-04-30 21:28 ` Michael Ivanov
2001-05-03 12:30   ` Serge Skorokhodov
2001-05-03 14:02     ` Sergey Vlasov
2001-05-03 15:54       ` Re[2]: " Serge Skorokhodov
2001-05-03 19:12         ` Sergey Vlasov
2001-05-04 19:18           ` Serge Skorokhodov
2001-05-04 19:22             ` Sergey Vlasov
2001-05-04 20:30               ` Serge Skorokhodov
2001-05-04 20:38                 ` Sergey Vlasov
2001-05-04 23:37                   ` Serge Skorokhodov
2001-05-03 20:24     ` Michael Ivanov
2001-05-03 21:22     ` Sergei
2001-05-04  9:50     ` Mikhail Zabaluev

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E14uAxT-000JQz-00@f11.mail.ru \
    --to=kr0n@mail.ru \
    --cc=mandrake-russian@altlinux.ru \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

ALT Linux Community general discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/community/0 community/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 community community/ http://lore.altlinux.org/community \
		mandrake-russian@linuxteam.iplabs.ru community@lists.altlinux.org community@lists.altlinux.ru community@lists.altlinux.com
	public-inbox-index community

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.community


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git