I don't understand this code logic

Discussion in 'SQL Server' started by Samuray99, Sep 5, 2021.

?

Can you elabrote 'void' part with details? So, I can't understand exactly.

  1. Reverse

    0 vote(s)
    0.0%
  2. Recursion

    0 vote(s)
    0.0%
  1. Samuray99

    Samuray99 New Member

    Joined:
    Sep 5, 2021
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    Gender:
    Male
    Code:
    #include void reverseSentence();
     int main() {
     printf("Enter a sentence: ");
     reverseSentence();
     return 0;
    } void reverseSentence() {
     char c;
     scanf("%c", &c);
     if (c != '\n') { reverseSentence();
     printf("%c", c);
     }
    }
    
     
  2. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,345
    Likes Received:
    382
    Trophy Points:
    83
    It is a predefine of a function that will be defined later somewhere. However, #include at the beginning of a line is wrong.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice