a is allocated the memory that is the length of the string, "Hello, ". Then, you try to set the character at the position just after that, when you start looping through b. char*a cannot be longer than "Hello, ", you need to allocate a new chunk of memory.
@ATaco Yes it does. 6.5.3.4§4 of the C11 Standard: When sizeof is applied to an operand that has type char, unsigned char, or signed char, (or a qualified version thereof) the result is 1.
> A tag system is a deterministic computational model published by Emil Leon Post in 1943 as a simple form of a Post canonical system. A tag system may also be viewed as an abstract machine, called a Post tag machine (not to be confused with Post-Turing machines)—briefly, a finite state machine whose only tape is a FIFO queue of unbounded length, such that in each transition the machine reads the symbol at the head of the queue, deletes a constant number of symbols from the head, and appends...
The last sentence you cut off actually explains it
You read the first character in the string, delete characters at the end and append a new string and then repeat until the first character is a special halting symbol
Introduction
Given five points in the plane, your task is to compute the area of the ellipse passing through these points.
You can assume that exactly one non-degenerate ellipse can be constructed with the given input values.
Rules
Input is 10 integers in any convenient form, corresponding to...
I am trying to identify the general case algorithm for counting the different ways dice can add to a given number. For instance, there are six ways to roll a seven with two 6-dice.
I've spent quite a bit of time working on this (for a while my friend and I were using Figurate numbers, as the ea...
CMP: Is implicit input at the end of a program a good idea? If so, how would Charcoal tell whether it's a number or a string? (implicit input meaning any missing operator args are filled in with input commands)
Newcomers to PPCG are often compelled to ask what many of our abbreviations and terms mean. Let us list them here so this information always will be easily available.
Cops and robbers
I have not determined exactly what the task shall be yet, so I'll use a placeholder task that has been used before.
I want feedback regarding the cops/robber part. Are there any pitfalls here? Will it be too hard to write an uncrackable Cop post?
The task
Write a piece of c...