Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.c++ > #87257 > unrolled thread
| Started by | Lynn McGuire <lynnmcguire5@gmail.com> |
|---|---|
| First post | 2022-11-05 15:16 -0500 |
| Last post | 2022-11-05 19:04 -0500 |
| Articles | 4 — 3 participants |
Back to article view | Back to comp.lang.c++
how to do implied do loops on write statements in C++ ? Lynn McGuire <lynnmcguire5@gmail.com> - 2022-11-05 15:16 -0500
Re: how to do implied do loops on write statements in C++ ? Michael S <already5chosen@yahoo.com> - 2022-11-05 13:29 -0700
Re: how to do implied do loops on write statements in C++ ? Bonita Montero <Bonita.Montero@gmail.com> - 2022-11-05 21:35 +0100
Re: how to do implied do loops on write statements in C++ ? Lynn McGuire <lynnmcguire5@gmail.com> - 2022-11-05 19:04 -0500
| From | Lynn McGuire <lynnmcguire5@gmail.com> |
|---|---|
| Date | 2022-11-05 15:16 -0500 |
| Subject | how to do implied do loops on write statements in C++ ? |
| Message-ID | <tk6gbg$180g$1@gioia.aioe.org> |
In converting my F77 code to C++, I am wondering how to do implied do
loops on write statements in C / C++ ?
write (oufile, 54555) (xyz (i), i = 1, ncp)
54555 format ('xyz=', (1x, g14.7), /)
Thanks,
Lynn
[toc] | [next] | [standalone]
| From | Michael S <already5chosen@yahoo.com> |
|---|---|
| Date | 2022-11-05 13:29 -0700 |
| Message-ID | <18859f39-7a4a-4935-9e90-e844eae87df9n@googlegroups.com> |
| In reply to | #87257 |
On Saturday, November 5, 2022 at 10:17:05 PM UTC+2, Lynn McGuire wrote:
> In converting my F77 code to C++, I am wondering how to do implied do
> loops on write statements in C / C++ ?
>
> write (oufile, 54555) (xyz (i), i = 1, ncp)
> 54555 format ('xyz=', (1x, g14.7), /)
>
> Thanks,
> Lynn
There is no direct equivalent in C++ .
You can use non-direct equivalents like like std::for_each(),
but if you value your sanity, please do not.
Just write explicit for() loop.
[toc] | [prev] | [next] | [standalone]
| From | Bonita Montero <Bonita.Montero@gmail.com> |
|---|---|
| Date | 2022-11-05 21:35 +0100 |
| Message-ID | <tk6heq$2ldcs$1@dont-email.me> |
| In reply to | #87258 |
Am 05.11.2022 um 21:29 schrieb Michael S: > There is no direct equivalent in C++ . > You can use non-direct equivalents like like std::for_each(), > but if you value your sanity, please do not. > Just write explicit for() loop. I use for_each sometimes when it's shorter.
[toc] | [prev] | [next] | [standalone]
| From | Lynn McGuire <lynnmcguire5@gmail.com> |
|---|---|
| Date | 2022-11-05 19:04 -0500 |
| Message-ID | <tk6tmr$b5k$1@gioia.aioe.org> |
| In reply to | #87258 |
On 11/5/2022 3:29 PM, Michael S wrote:
> On Saturday, November 5, 2022 at 10:17:05 PM UTC+2, Lynn McGuire wrote:
>> In converting my F77 code to C++, I am wondering how to do implied do
>> loops on write statements in C / C++ ?
>>
>> write (oufile, 54555) (xyz (i), i = 1, ncp)
>> 54555 format ('xyz=', (1x, g14.7), /)
>>
>> Thanks,
>> Lynn
>
> There is no direct equivalent in C++ .
> You can use non-direct equivalents like like std::for_each(),
> but if you value your sanity, please do not.
> Just write explicit for() loop.
That is what I do now.
Thanks,
Lynn
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.c++
csiph-web