Thread: Single pointer allocation of counter and TIme Programming

  1. #1
    Registered User
    Join Date
    Aug 2023
    Posts
    2

    Single pointer allocation of counter and TIme Programming

    TIME Programming of C by one digit Pointer

    Code:
    #include <stdio.h> 
    #include <unistd.h>
    #include <stdlib.h>
      //HH:MM:SS
    int main()
    {
    int A=0,B=0,C=0,D=0,E=0,F=0,i=0;
    for(F=0;"";F++) 
    {
    if(F==10) 
    {
    F=0;
    E++;
    if(E==6)
    {
    E=0;
    F++;
    }
    }
    if(F==9 && E==5)
    {
    D=D+1;
    if(D==10)
    {
    D=0;
    C=C+1;
    if(C==6)
    {
    C=0;
    B=B+1;
    if(B==3)
    {
    B=0;
    A=A+1;
    if(A==2)
    {
    A=0;
    }
    }
    }
    }
    }
    system("clear");
    system("date");
    system("0");
    system("gcc -S 12HOUR_12.C");
    printf("HouR : MiN : SeC \n");
    printf("%d%d    : %d%d    : %d%d \n",A,B,C,D,E,F);
    fflush(stdout);
    sleep(1); 
    }
    }

  2. #2
    Registered User
    Join Date
    Dec 2017
    Posts
    1,633
    Do you have a question? What do you mean by "single pointer allocation"?

    Also, indentation???

    The empty string here is meaningless.
    Code:
    for (F = 0; ""; F++)
    Instead you should leave it blank
    Code:
    for (F = 0; ; F++)
    This is meaningless
    Code:
    system("0");
    This is totally pointless (and the capital C filename suffix suggests you might be compiling this as C++) :
    Code:
    system("gcc -S 12HOUR_12.C");
    There are also errors in your logic.
    E.g., start at time 00:00:57 and the next few times are:
    Code:
    00    : 00    : 58 
    00    : 01    : 59    <== should be 00:00:59
    00    : 01    : 01    <== should be 00:01:00
    E.g., start at time 02:59:57 and the next few times are:
    Code:
    02    : 59    : 58 
    10    : 00    : 59    <== should be 02:59:59
    10    : 00    : 01    <== should be 03:00:00
    A little inaccuracy saves tons of explanation. - H.H. Munro

  3. #3
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,661
    So is F the most significant digit of hours, or the least significant digit of seconds?
    Who knows from your alphabet soup.

    Pick better variable names.

    Code:
    #include <stdio.h>
    #include <unistd.h>
    #include <stdlib.h>
    //HH:MM:SS
    int main()
    {
        int h_tens=0,h_units=0,m_tens=0,m_units=0,s_tens=0,s_units=0,i=0;
        for(s_units=0; ""; s_units++)
        {
            if(s_units==10)
            {
                s_units=0;
                s_tens++;
                if(s_tens==6)
                {
                    s_tens=0;
                    s_units++;
                }
            }
            if(s_units==9 && s_tens==5)
            {
                m_units=m_units+1;
                if(m_units==10)
                {
                    m_units=0;
                    m_tens=m_tens+1;
                    if(m_tens==6)
                    {
                        m_tens=0;
                        h_units=h_units+1;
                        if(h_units==3)
                        {
                            h_units=0;
                            h_tens=h_tens+1;
                            if(h_tens==2)
                            {
                                h_tens=0;
                            }
                        }
                    }
                }
            }
            printf("%m_units%m_units    : %m_units%m_units    : %m_units%m_units \n",h_tens,h_units,m_tens,m_units,s_tens,s_units);
            sleep(1);
        }
    }
    It then becomes immediately obvious that certain things don't make any sense at all.

    Such as line 17, where you should be incrementing m_units, not s_units.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  4. #4
    Registered User
    Join Date
    Aug 2023
    Posts
    2
    The variation of program decides by compiler of each cpu architecture, for(F=0;"";F++) Represent infinite count of numerics or loops 0 to infinity if any blocks appear means the cpu compilation stopped by malloc operation of header file library or standard disassemble operation by the asm code.
    its not time code program is just a tool the application architection depend on the code logic thats write. the timer is infinity compilation while compilation of for loop function in asm leading the creation of cpu timer art of time pricols as per all cpu in the world have same timer logic of one second less than speed of real clock but the real clock speed will be calculation of delay of each govt times. the time not run by timer of cpu. the timer is constant for measure time of the speed in all land technology exmple 3d map server ran on time of android library but timer detects the 3d map time delay that happen while aircraft flying on sky.

    system("gcc -S 12HOUR_12.C"); Represent the timer validate itself by each time compilation of timer of bios leads the cpu become neutral of all processing units the all arithmetic process in computer ran by timer of bios chip in any architecture each time compilation inside system command call will clearing the each process tlb memory block which represent i protect my system process by my c program compilation one compilation within infinity compilation of each timer count.

    Single pointer allocation means the time after 9 second its 10 by odo meter old motor cycle logic if 9 counts increase then 10 will come as count to the asm by disassembler of cpu cache
    Last edited by sivaraman95; 08-20-2023 at 08:56 AM. Reason: Clarity

  5. #5
    Registered User
    Join Date
    Dec 2017
    Posts
    1,633
    Clearly it is impossible to communicate with this entity.
    It's interesting how pure stupidity and outright mental disease are indistinguishable.
    A little inaccuracy saves tons of explanation. - H.H. Munro

  6. #6
    Registered User Sir Galahad's Avatar
    Join Date
    Nov 2016
    Location
    The Round Table
    Posts
    277
    Last edited by sivaraman95; 7 Hours Ago at 08:56 AM. Reason: Clarity
    Yes, clearly total nonsense....

  7. #7
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,661
    Quote Originally Posted by sivaraman95 View Post
    The variation of program decides by compiler of each cpu architecture...
    It's like you put a technical dictionary into a food blender then picked out all the words that were still legible.

    It's just keyword soup seasoned with a few buzzwords.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  8. #8
    Registered User
    Join Date
    Apr 2019
    Posts
    121
    Might this have been created by AI?

  9. #9
    Registered User
    Join Date
    Dec 2017
    Posts
    1,633
    Artificial Idiot?
    It responded to the points I made in my post.
    I'm pretty sure it's just a nutcase with a layer of ESL obfuscation.
    A little inaccuracy saves tons of explanation. - H.H. Munro

  10. #10
    Registered User Sir Galahad's Avatar
    Join Date
    Nov 2016
    Location
    The Round Table
    Posts
    277
    Quote Originally Posted by Yonut View Post
    Might this have been created by AI?
    Doubtful. I got better results playing around with Markov chains!

  11. #11
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,661
    This roast is done, sticking a fork in it.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 1
    Last Post: 03-26-2020, 05:47 PM
  2. dynamic memory allocation for single variable
    By Player777 in forum C Programming
    Replies: 4
    Last Post: 02-03-2020, 08:00 AM
  3. Time Stamp Counter
    By c_lady in forum C++ Programming
    Replies: 3
    Last Post: 03-23-2010, 10:53 AM
  4. Counter (Time)
    By PickleBranston in forum C Programming
    Replies: 16
    Last Post: 02-10-2009, 01:00 PM
  5. Time.h and counter
    By mattz in forum C Programming
    Replies: 9
    Last Post: 12-11-2001, 03:31 PM

Tags for this Thread