Search Results

Found 1 results for "5c943b06193cd62a57ce385685558598" across all boards searching md5.

Anonymous /g/105591698#105600146
6/15/2025, 1:51:04 PM
>>105600117
(ntt)
abstract objects
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

struct s_str_a
{
size_t size;
char *text;
};

struct s_str_b
{
size_t size;
char text[];
};


int main(void)
{
char text[] = "this is a string";
struct s_str_a *str_a = malloc(sizeof(struct s_str_a));
struct s_str_b *str_b = malloc(sizeof(struct s_str_b) + sizeof(text));

str_a->text = text;
strcpy(str_b->text, text);

puts(str_a->text);
puts(str_b->text);


}

the practical difference is an additional level of dereferencing