Alright. Got the L"" strings working and the tests are in. The GCC patch is about as done as the Clang one, and it has exception support too.

#include <embed>

#depend "MAINTAINERS"

int main () {
static constexpr std::span<const std::byte> data2 =
std::embed(L"MAINTAINERS", 3, 1);

static_assert(data2.size() == 1);
static_assert((unsigned char)(data2[0]) == 'e');

return (int)data2[0];
}
Aha! memmove I have found you!


#include <string.h>

void *
memmove(void *dst, const void *src, size_t len);

This is like memcpy but the ranges can overlap.
I was using memcpy to a tmp array and then
memcpy back to the original.

:)

#c #memmove

So, I thought the exercise at the end was going to make my brain itch...Instead it was really easy (challenge is included in screenshot). Here is the answer based on what they wanted:

#include <stdio.h>

int main() {
int numbers[5];

numbers[0] = 10;
numbers[4] = 50;

printf("%d\n", numbers[0]);
printf("%d\n", numbers[4]);

return 0;
}

The output should end up being:
10
50

I'm beginning to kind of understand C a little bit, not by much because it took a long time for me to figure this out. LMAO Progress is incremental, now it's time to look at strings!

#programming #C

Given a number n, the task is to find the n-th term in series 1, 6, 18, 40, 75, …Example:   Input: N = 2 Output: 6 Explanation: 2nd term = (2^2*(2+1))/2 = 6 Input: N = 5 Output: 75 Explanation: 5th term = (5^2*(5+1))/2 = 75 Approach:   Nth term = (N^2*(N+1))/2   Implementation of the above approach is given below:   C++ // CPP code to generate // 'Nth' term of this sequence   #include using namespace std;   // Fu...
https://neveropen.tech/find-nth-term-of-the-series-1-6-18-40-75/?fsp_sid=126114

"La compilation n'est pas une science occulte" écrivait en 2014 Philippe Dunski en annexe de son livre "Coder efficacement –Bonnes pratiques et erreurs à éviter (en C++)", toujours d'actualité dix ans après.

Pourquoi un simple #include <iostream> génère-t-il un fichier de 17 000 lignes ? Pourquoi obtient-on une erreur "undefined reference to" ?

Ce texte, proposé en article sur notre site, l'explique avec des mots simples.

👇
https://www.d-booker.fr/content/273-la-compilation-n-est-pas-une-science-occulte

La compilation n'est pas une science occulte

La compilation est souvent mal comprise des débutants, quand elle ne passe pas pour une boîte noire impénétrable. Cette article explique clairement la chaîne de compilation C++ : préprocesseur, analyse lexicale, assembleur et édition de liens.

Éditions D-BookeR

@bot #sdcc
#include <stdio.h>

void beep(int divisor, int duration) {
divisor;
duration;
__asm
ld l,4 (ix)
ld h,5 (ix)
ld e,6 (ix)
ld d,7 (ix)
call 0x3b5
__endasm;
}

void main() {
beep(1000,20);
beep(750,20);
beep(500,20);

while (1);
}

@bot #sdcc
#include <stdio.h>

// NOTE: The following is required by the 'printf' function!
int putchar(int ch) {
if (ch == 10) ch = 13; // newline -> CR
__asm
ld a,4 (ix)
rst 0x10
__endasm;
return ch;
}

int main() {
printf("Hello, World!\r");
while (1); // TODO: How to return control to BASIC?
return 0;
}

@bot #sdcc
#include <stdio.h>

void beep(int divisor, int duration) {
divisor;
duration;
__asm
ld l,4 (ix)
ld h,5 (ix)
ld e,6 (ix)
ld d,7 (ix)
call 0x3b5
__endasm;
}

void main() {
beep(1000,20);
beep(750,20);
beep(500,20);

while (1);
}

Lastly, what does this even mean?

Don't let your reviewing work go unnoticed! Researchers the world over use Web of Science to effortlessly track their valuable peer review contributions for any journal. If you opt in, your Web of Science profile will automatically be updated to show a verified record of this review in full compliance with the journal's review policy. If you don't have a Web of Science profile, you will be prompted to create a free account.Learn more about Web of Science

If I click yes, am I de-anonymizing my anonymous review? That seems like an incredibly obvious question, but no one here has ever bothered to think about it, because the answer is also not in the 🤯 FAQ.

(And yes, maybe the answer varies. #include a different goddamned HTML block based on journal configuration.)

Mittlerweile ist die noch minimaler und sauberer. Ich entwickle die Apps zusammen mit der ABI. Hier mal ein aktuelles Beispiel: //kernel abi #define DOT_NEW_ABI #include <app_dot.h> // main int app(int argc, char** argv, kernel_abi_t *sys) { sys->log("Hello World!\n"); return 0; }