Re: flow control statement

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Jul 25, 2019 at 1:45 AM Ali MURAT <alimupas2@xxxxxxxxx> wrote:
>
> Actually, I wanted for both. (c++ and c )
>
> On 7/25/2019 1:52 AM, Ali MURAT wrote:
> > Thanks, I wanted to write my own custom construct.

The https://en.wikipedia.org/wiki/C_preprocessor works for both C and C++.

And, you can see many examples of preprocessor actions by browsing
https://stackoverflow.com/questions/tagged/c-preprocessor?sort=Newest
and ask there for help in developing your own custom loop construct.

> > I asked it how
> > could do it. There was a gcc url in the file. so I thought it was
> > general.
> > with windows dll file, is it doing

-- 
Best regards,
Tadeus

> > On 7/24/2019 1:35 PM, Tadeus Prastowo wrote:
> >> On Wed, Jul 24, 2019 at 8:18 AM Ali MURAT <alimupas2@xxxxxxxxx> wrote:
> >>> I'm sorry if more than one unfinished email came to you somehow.
> >>> because
> >>> I noticed unfinished emails, and I am not be sure that you went to you.
> >>>
> >>> On 7/24/2019 8:56 AM, Ali MURAT wrote:
> >>>>> you mean that you want to write a new language construct that extends
> >>>>> the existing C language constructs?
> >>>> Yes, I have intent that improving the c language and I getting a new
> >>>> idea as I  gain experience
> >>>>
> >>>> in the simplest form, when I want to calculating the number of cycles
> >>>> of a consecutive number in the simplest, it easily did not be done
> >>>> with this(for) command
> >>>>
> >>>> For example of
> >>>> #------------------------------------------------------------------
> >>>> // Example program
> >>>> #include <iostream>
> >>>> #include <string>
> >>>> using namespace std;
> >>>> int main()
> >>>> {
> >>>>   for (int i=1;i<=9;i+=2)
> >>>>   {
> >>>>       cout<<"hadi, bana sayiyi goster:"<<i<<endl;
> >>>>       }
> >>>> }
> >>>> #------------------------------------------------------------------
> >> Please be aware that you are using C++ language constructs, not C.
> >> While C++ strives to be compatible with C (see
> >> https://events.yandex.ru/lib/talks/1954/), C and C++ are different.
> >>
> >>>> ----------------------------------
> >>>> hadi, bana sayiyi goster:1 cycles of 0
> >>>> hadi, bana sayiyi goster:3 cycles of 1
> >>>> -----
> >>>> hadi, bana sayiyi goster:9 cycles of 3
> >>>>
> >>>>
> >>>> it here is end, but, I am not want this and I want as it is like
> >>>> follows.
> >>>>
> >>>> -------------------
> >>>> hadi, bana sayiyi goster:1 cycles of 0
> >>>> hadi, bana sayiyi goster:3 cycles of 1
> >>>> -----
> >>>> hadi, bana sayiyi goster:9 cycles of 3
> >>>> ----
> >>>> hadi, bana sayiyi goster:13 cycles of 5
> >>>> hadi, bana sayiyi goster:19 cycles of 8
> >>>> hadi, bana sayiyi goster:21 cycles(loop) of 9
> >>>>
> >>>> ----
> >>>> I found the key(answer) of this in other way
> >>>> increase amount:2
> >>>> loop  amount:80
> >>>> regular consecutive odd numbers:x+3
> >>>> regular consecutive even numbers:x+4
> >>>> solution way:
> >>>> 80*2=160+((3) or (4))
> >>>> ----------------------
> >>>> düzensiz artan fakat artış miktarı düzenli olan bir sayı bloğu için
> >>>> kolaylık sağlanabilir.
> >>>> a number block that is irregularly increased but whose loop amount of
> >>>> increase is regular may be facilitated.
> >>>>
> >>>>
> >>>> So, the main point here is to introduce the number of loop to
> >>>> this(for) command!
> >>>>
> >>>> As I write code, I come up with various ideas. they are simple but
> >>>> necessary. when I work on more complex code, if I found anything I
> >>>> share it for you to get an idea.
> >>>>
> >>>> anybody may have been experiencing such a problem. When writing code
> >> You can achieve what you want with preprocessor macros (see
> >> https://en.wikipedia.org/wiki/C_preprocessor).
> >>
> >> If you have further questions on extending the C and C++ through
> >> preprocessor macros, please browse
> >> https://stackoverflow.com/questions/tagged/preprocessor-meta-program%20c-preprocessor?sort=Newest
> >>
> >> and, if needed, ask there, not here due to this having nothing to do
> >> with GCC anymore, which is a collection of compilers.
> >>
> >> Thank you.
> >>




[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux