Thread: A piece of code activates only once at start of the program

  1. #1
    Registered User
    Join Date
    Feb 2020
    Posts
    2

    A piece of code activates only once at start of the program

    Is it possible that a code activates only once when the programm starts and then never again? I want to send the User a message and after the program has a run through the message turns every time up...

    sorry for my english, I tried my best
    Last edited by BimKurzAfk; 02-11-2020 at 08:21 AM.

  2. #2
    Registered User
    Join Date
    Dec 2017
    Posts
    1,628
    Quote Originally Posted by BimKurzAfk View Post
    Is it possible that a code activates only once when the program starts and then never again?
    Of course. But I'm not sure I understand what you mean.

    Code:
    #include <stdio.h>
    
    int main()
    {
        printf("Hello\n");  // happens once, then never again
    
        for (int i = 0; i < 10; ++i)
            printf("%d\n", i);
    
        return 0;
    }
    A little inaccuracy saves tons of explanation. - H.H. Munro

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. How do I fix this piece of code?
    By deepee in forum C Programming
    Replies: 32
    Last Post: 12-04-2013, 08:06 PM
  2. Can someone help me with this small piece of code
    By Avanish Giri in forum C Programming
    Replies: 6
    Last Post: 04-09-2012, 07:11 PM
  3. K&R2 - Piece of code not working.
    By reqonekt in forum C Programming
    Replies: 2
    Last Post: 11-13-2009, 11:07 AM
  4. Help with a piece of code
    By Victor4015 in forum C++ Programming
    Replies: 1
    Last Post: 11-16-2005, 05:38 PM
  5. Help with a little piece of code
    By cdonlan in forum C Programming
    Replies: 5
    Last Post: 11-15-2004, 12:38 PM

Tags for this Thread