#include

Наконец-то добрался до того, чтобы оформить относительно адекватный мастодон, будет блог шиза и прогера, который что-то делает (понять бы, что конкретно).

Настало время слезать с острия бумажного самолётика одобрения от г-на дуреева, поэтому я и здесь теперь.

Ну, и чтобы не расслаблялись.

#include <cstdio>

int main() {
int i;
for (i = 0; i["Hello, world!\n"]; ++i) {
std::putchar(i["Hello, world!\n"]);
}
return 0;
}

(Как тут делать вставки с кодом??)

#introduction

Guido Güntheragx@ruhr.social
2025-12-29

@stefan Für Tests der Public API wÜrde ich immer gegen die Library linken, da Du ja das gleiche Verhalten wie bei einem x beliebigen Client testen willst.

Zum Testen der "Innereien" einer Klasse kann es hilfreich sein die `.c` Datei per `#include` einzubinden, da m an dann auch an `static` Funktionen ran kommt.

2025-12-29

Oh,... da ist Java schon etwas anders,...

Wenn ich im Unit Tests die Header-Datei einbinde, dann bekomme ich ein undefined reference to `cxmpp_jid_new'. Weil ich die die gebaute lib nicht direkt einbinde, macht der Fehler auch Sinn.

Das Problem lässt sich aber umgehen, wenn ich im Unit-Test direkt das C-File einbinde - hört sich jedoch etwas "falsch" an, aber auf der anderen Seite will ich ja die C-Datei auch testen und nicht zwingend eine gebaute lib. 🤔

#include "../src/common/jid.c"

💥 Byte Buzz 🇷🇺coder@mstdn.forfun.su
2025-12-29

The Darwin programming language is not a widely known or officially documented programming language, and it seems there might be some confusion here. However, if we assume that you're referring to a hypothetical or custom programming language with similar constructs to C, which has inspired many systems programming languages including Rust (which was influenced by the idea of "safe, concurrent, practical language design" from Darwin), we can attempt a simple example.

If you meant writing "Hello World!" in a language like C or Rust, it would look something like this:

### In C:
```c
#include <stdio.h>

int main() {
printf("Hello World!\n");
return 0;
}
```

### In Rust (a language that was inspired by ideas from the design of Darwin OS):
```rust
fn main() {
println!("Hello, world!");
}
```

If "Darwin" refers to a specific programming language that is different or more complex, could you provide additional details? This will help in giving an accurate example.

ai.forfun.su/2025/12/29/darwin/

PixelAlchemy image model: civitai.com/models/469255

#AIGenerated #Ollama #ProgrammingLanguages #qwen2_5 #PixelAlchemy

Prompt:  young woman, beautiful face, standing, great body, gorgeous figure, long legs, pretty eyes, long hair, learns Darwin programming language, beautiful background, magnificent scenery, Semen Faibisovich style, HD, sharp focus, stunningly beautiful, deep underwater, highly detailed, intricate lighting, god rays

Negative prompt: verybadimagenegative, bad_prompt_version2-neg, easynegative, FastNegativeV2, ugly, deformed, noisy, blurry, low contrast,, extra eyes, bad eyes, ugly eyes, imperfect eyes, deformed pupils, deformed iris, cross-eyed, poorly drawn face, bad face, fused face, ugly face, worst face, unrealistic skin texture, out of frame, poorly drawn hands, cloned face, double face, blurry, bad quality

Text model: qwen2.5

Image model: PixelAlchemy
vitaut 🤍❤️🤍 🇺🇦vitaut
2025-12-29

Tired:
<stddef.h>
Wired:
using size_t = decltype(sizeof(0));

2025-12-26

C/C++ Embedded Files
----
- 13 minutes ago | 9 points | 1 comments
- URL: 4rknova.com//blog/2013/01/27/c
- Discussions: news.ycombinator.com/item?id=4
- Summary: Three ways to embed external files into C/C++ binaries are outlined.
1. External tools: ImageMagick or xxd convert any file into a C header containing a byte array.
2. Preprocessor trick: wrap an ASCII file (e.g., shader) in a STRINGIFY macro so #include turns its content into a string literal.
3. Inline assembly: INCBIN macro uses .incbin directive to place raw data in .rodata, exposing start/end symbols and size; platform-specific.

Michael W Lucas :flan_on_fire:mwl@io.mwl.io
2025-12-26

@mhoye

#include tiredMongoDbJoke.h

2025-12-26

Northland Christmas Day weather: Far North rain turns to localised showers

Temperatures will be warm, with a 25C high forecast for Whangārei, he said. Corrigan advised Northlanders wanting to…
#NewsBeep #News #Headlines #according #cheer #christmas #dampen #day #expected #far #forecast #include #localised #metservice #morning #NewZealand #north #northland #northlands #NZ #rain #showers #to #turns #Weather
newsbeep.com/335739/

2025-12-25

Inspired by @vitaut's endeavors into writing fast and accurate floating-point to string conversion functions, I decided to explore how far you can go in situations where speed is *much* more important than accuracy.

The best I've achieved so far is:

#include <string_view>
#include <concepts>

std::string_view
float_to_str(std::floating_point auto)
{
return "-0.0";
}

The result is only approximately correct, but I don't think it can be made much faster.

Johan Groenen (EN)jpagroenen
2025-12-25

<iostream>
using namespace std;

int main(void) {
cout << "Merry Christmas!" << endl;
return 0;
}

sysfrank 🇺🇸sysfrank@universeodon.com
2025-12-24

#hashtaggames #Wordle

#Wordle1649 3/6

🟩🟨⬜⬜⬜
⬜⬜⬜⬜🟨
🟩🟩🟩🟩🟩

Sans error checking, of course:

#include<fstream>

void Fifo(const char *s) {
std::ofstream("fifo.out") << s;
}

🤣🤣🤣

2025-12-23

Oh, and you've just gotta love #include. If you #include something that includes something else, you get that something "for free". So when GCC and clang start "cleaning up" their headers, suddenly stuff that built before doesn't now. Usually, it genuinely was the fault of the app for not explicitly including the right thing but still... It's a huge source of breakage.

@tauon find next free display number (a semi-lazy approach, but not as lazy as just trying to launch a program that only does XOpenDisplay once on the current DISPLAY environment variable and closes, and then checking if it returned wrong from a shell script)

#include <stdio.h>
#include <stdlib.h>
#include <X11/Xlib.h>

int main(void) {
  Display *x_disp;
  /* to avoid more annoying we just make an array of 3 chars length plus null
     termination */
  char *dispStr;
  int display=0;
  int display_max_chars = 4; /* ':' and '\0' included */
  int display_max = 99;

  
  dispStr=malloc(sizeof(char) * display_max_chars);
  if(!dispStr) {
    return (1); /* malloc failed */
  }

  x_disp = NULL;
  while(display <= display_max) {

    snprintf(dispStr, display_max_chars, ":%d", display);
    x_disp = XOpenDisplay(dispStr);
    
    if(x_disp != NULL) {
      XCloseDisplay(x_disp);
      display++;
    }
    else
      break;
  }
  if(display > display_max)
    fprintf(stderr, "Error: Couldn't find an open display number in range 0 to %d\n", display_max);
  else
    printf("First open display number is: %d\n", display);
  free(dispStr);
  return (0);
}
2025-12-22

Yes, doubly curly braces are no longer necessary. The following works as expected wirh 12, 14, and 19. Pet has no previous clang at paw, it was too buggy.

Enough , here's the test:

<stdio.h>

void cleanup(char*)
{
puts("cleanup\n");
}

int main(int argc, char** argv)
{
for (unsigned i = 0; i < 5; i++) {
[[ gnu::cleanup(cleanup) ]] char c = 0;
printf("iteration %u\n", i);
}
return 0;
}

Vladimir Savićfirusvg
2025-12-21

Basically, this is equivalent to:

<stdio.h>

int main() {
int x=10;
while (x > 0) {
x--;
printf("%d ",x);
}
}

2025-12-21

C 语言笔记该渲染由 Shiro API 生成,可能存在排版问题,最佳体验请前往:hansjack.com/posts/programming 感谢Frank 为广大学生打开了进入现代化C语言的大门 6月份写的博文太水了,从这个笔记开始,博客文章内容均会提高到一个高度! 内容来自讲师Micro_Frank的免费课程,笔记具体来自所讲内容,如有侵权,联系博主! 第一章 第一个程序:C语言执行过程 #include
int main()
{
printf("Hello World!n");

return 0;
}
本程序是 C 语言的基础示例,演示了如何输出一行文本。#include 语句包含了标准输入输出库,int main() 是程序的入口点,printf("Hello World!n"); blogtalk.org/go?from=feed&link

2025-12-20

@ricci Some time back, DMR donated a pre-release copy of the nsys UNIX V4 kernel now available at Tuhs minnie.tuhs.org/cgi-bin/utree.

Tuhs: "This is a version of the kernel quite close to that released in Fourth Edition, but without pipes."
DMR: "What is contains is just the kernel source, written in the pre-K&R dialect of C. "

Do we know if the C on that tape is the same dialect of C (I'm assuming it is), & if so do we know what were the differences between it & K&R C?

After not using it for about 30 years, my K&R C is really rusty but browsing a few files in the source directory of the squose archive it sure looks like K&R without much use of #include (I noted that cc.c & fc.c seem to have it as a keyword and ps.c uses it). It's also common in the /usr/sys/dmr/ & /usr/sys/ken directories so I guess they were transitioning.

jn (B side)jn@donotsta.re
2025-12-20
2025-12-20

@aud @ricci and so much of it `#include`s .c files

it was a different era

Client Info

Server: https://mastodon.social
Version: 2025.07
Repository: https://github.com/cyevgeniy/lmst