Content Warning

This website contains age-restricted materials including nudity and explicit depictions of sexual activity.

By entering, you affirm that you are at least 18 years of age or the age of majority in the jurisdiction you are accessing the website from and you consent to viewing sexually explicit content.

Lemmy NSFW
  • Communities
  • Create Post
  • Create Community
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
Sjmarf@sh.itjust.works to Programming Horror@programming.dev · 7 months ago

mallocPlusAI

message-square
29
link
fedilink
258

mallocPlusAI

Sjmarf@sh.itjust.works to Programming Horror@programming.dev · 7 months ago
message-square
29
link
fedilink
  • zaphod@sopuli.xyz
    link
    fedilink
    arrow-up
    14
    ·
    7 months ago

    You don’t need to cast the return value from malloc.

    • Subverb@lemmy.world
      link
      fedilink
      arrow-up
      6
      ·
      edit-2
      7 months ago

      This isn’t malloc though. I have to assume the cast is because the user has experience with the output from an LLM being untrustworthy.

    • vrighter@discuss.tchncs.de
      link
      fedilink
      arrow-up
      2
      ·
      7 months ago

      you do in c++, no?

      • zaphod@sopuli.xyz
        link
        fedilink
        arrow-up
        2
        ·
        7 months ago

        In c++ you should use new.

        • vrighter@discuss.tchncs.de
          link
          fedilink
          arrow-up
          1
          ·
          7 months ago

          that is besides the point. You can still call malloc, it will still return void*, and it would still reqoire casting in c++

Programming Horror@programming.dev

programming_horror@programming.dev

Subscribe from Remote Instance

Create a post
You are not logged in. However you can subscribe from another Fediverse account, for example Lemmy or Mastodon. To do this, paste the following into the search field of your instance: [email protected]

Welcome to Programming Horror!

This is a place to share strange or terrible code you come across.

For more general memes about programming there’s also Programmer Humor.

Looking for mods. If youre interested in moderating the community feel free to dm @[email protected]

Rules

  • Keep content in english
  • No advertisements (this includes both code in advertisements and advertisement in posts)
  • No generated code (a person has to have made it)

Credits

  • Icon base made by Lorc under CC BY 3.0 with modifications to add a gradient
Visibility: Public
globe

This community can be federated to other instances and be posted/commented in by their users.

  • 1 user / day
  • 1 user / week
  • 9 users / month
  • 39 users / 6 months
  • 2 local subscribers
  • 2.08K subscribers
  • 36 Posts
  • 244 Comments
  • Modlog
  • mods:
  • Vacant@programming.dev
  • UI: 0.19.11-nsfw
  • BE: 0.19.11
  • Modlog
  • Legal
  • Instances
  • Docs
  • Code
  • join-lemmy.org