p.enes.lv is a Fediverse instance that uses the ActivityPub protocol. In other words, users at this host can communicate with people that use software like Mastodon, Pleroma, Friendica, etc. all around the world.

This server runs the snac software and there is no automatic sign-up process.

Site description
when penes love repeats
Admin account
@eris@p.enes.lv

Search results for tag #include

[?]GNU/翠星石 » 🌐
@Suiseiseki@freesoftwareextremist.com

@twinspin6 GNU C programmers don't even need for or while - goto will do;
#include <stdio.h>

int main()
{
int i = 0;

loop: printf("%d\n", i);
if (i++ == 8) {goto exit;}
goto loop;

exit: return 0;
}

    [?]GNU/翠星石 » 🌐
    @Suiseiseki@freesoftwareextremist.com

    @twinspin6 But that wasn't GNU enough - now loop without goto or function recursion;
    #include <stdio.h>
    #include <stdlib.h>

    int main()
    {
    int i = 0;

    loop: printf("%d\n", i);
    if (i++ == 8){exit(0);}

    void (*loop)() = &&loop;
    loop();

    }

      [?]Linus Tip Tips » 🌐
      @neko@clubcyberia.co

      @i Sure, though I think that keeping the cxx bindings in a separate folder is cleaner, so if the user needs to read the headers manually they wont be all cluttered in the same directory.

      After reflection i ended up going with the latter, that way the user can still do #include <mastodont-cxx/mastodont.h>, and it wont allow for weird cases like #include <cxx/mastodont.h>. I like to think of them as separate, anyway

        [?]moved, again » 💔 🌐
        @nyanide@lab.nyanide.com

        what did i do wrong????

        #include <stdio.h>
        #include <string.h>
        
        void recursePrunePattern(char **thing, char *pattern) {
                char *found = strstr(thing[0], pattern);
                if (found == NULL)
                        return;
                for (int i = 0; found[i] != '\n'; i++)
                        found[i] = ' ';
                recursePrunePattern(&found, pattern);
        }
        
        int main() {
                char *str = "hello world // poop\n";
                recursePrunePattern(&str, "//");
                puts(str);
        }
        

          1 ★ 0 ↺

          [?]GNUkko Sauvage (eris-ng) :neorenard: » 🌐
          @eris@p.enes.lv

          Ok, I'm wrong (but so are you), multicharacter character literals are cursed anyways. https://onlinegdb.com/sfxg6T53t

           <stdio.h>

          int main()
          {
          __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
          puts("Little endian");
          __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
          puts("Big endian");

          printf("ayo wtf %d\n", __BYTE_ORDER__);

          printf("%", 'twinspin6');
          return 0;
          }

          main.c: In function ‘main’:
          main.c:12:19: warning: character constant too long for its type
          12 | printf("%", 'twinspin6');
          | ^~~~~~~~~~~
          Little endian
          0b1110000011010010110111000110110

            0 ★ 0 ↺

            [?]GNUkko Sauvage (eris-ng) :neorenard: » 🌐
            @eris@p.enes.lv

            That sounds like C not C++. <stdbool.h> or add a -std=gnu23 (or -std=gnu2x depending on how old your compiler is).

              2 ★ 0 ↺

              [?]GNUkko Sauvage (eris-ng) :neorenard: » 🌐
              @eris@p.enes.lv

              You can probably live without stuff like runtime type information and exceptions in a kernel. What remains is trivial stuff like global constructors, stuff like file access which you will be implementing yourself anyways, and stuff that requires dynamic allocation, like std::vector, std::string, but those have template arguments for specifying custom allocators. And if you're not ing the specific headers, you don't need to support that shit ¯\_(ツ)_/¯

              CC: @p@fsebugoutzone.org @shibao@misskey.bubbletea.dev