Search Results
7/26/2025, 10:16:52 PM
>>106037983
also
>they replaced arrays with pointers
no, thats autism
theres a nuance bw both bc a pointer is a reference when an array is a tangible meme-ory object
you fukken autismo dweeb
#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);
}
disassemble this, you filthy casual
also
>they replaced arrays with pointers
no, thats autism
theres a nuance bw both bc a pointer is a reference when an array is a tangible meme-ory object
you fukken autismo dweeb
#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);
}
disassemble this, you filthy casual
7/25/2025, 10:14:05 PM
Page 1