Number of Posts going crazy?

Am I wrong, or from 700 posts I had like, not even last week, i did nomore than 100 posts? I have 818 posts as I write this, Is it me that writes this much or?
Last edited on
Maybe you made too many posts about how many posts you made?
Joking, of course. Just wanted to point out the recursion in the issue.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#include <iostream>

int PutHowManyPostsIMade(int NumberOfPosts);

int PutHowManyPostsIMade(int NumberOfPosts)
{
      if(NumberOfPosts==0)
      {
           return(0);
      }
      std::cout<<"The number of posts you made that we have not counted are: "<<NumberOfPosts<<std::endl;
      std::cin.ignore();
      std::cout<<"Moving on!"<<std::endl;
      std::cin.ignore();
      PutHowManyPostsIMade(NumberOfPosts-1);
}

main()
{
     int NumberOfPosts;
     
     std::cout<<"How many posts have you made?"<<std::endl;
     std::cin>>NumberOfPosts;
     PutHowManyPostsIMade(NumberOfPosts);
     std::cin.ignore();
}


I never really understood recursion hamsterman, but is this an example of what it is?
It's a fine example of undefined behavior.
EssGeEich wrote:
Is it me that writes this much or?


That depends... do you have any split personalities or imaginary friends? ;)

All the best,
NwN
@usandfriends, I was thinking about
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
struct EssGeEich{
   int post_count;
   const int too_many_posts;

   //...

   void post(std::string message) {
      //...
      post_count ++;
      if(post_count > too_many_posts) react_to_post_count();
   }

   void react_to_post_count() {
      post("how come I have so many posts?");
   }
};
Well, Happy New Year to Everyone, and, for the moment, everything seems all right. Yet I'm not sure why such a postcount jump.
hamsterman wrote:
struct EssGeEich{

Lol?
Thanks Hamsterman!
Topic archived. No new replies allowed.