BinaryByter
And C# Is a superset of C++
I doubt that you can compile any C++ in C#
MᏫᎻᎯᎷᎷᎬᎠ
@BinaryByter auto a = malloc(10); Worked in C++
Pavel
Well, you can use it as a memory pool, for example
Also objects pool, but I would use C++ with std::vector for that :)
MᏫᎻᎯᎷᎷᎬᎠ
BinaryByter
BinaryByter
but we are talking about C
MᏫᎻᎯᎷᎷᎬᎠ
Hmm
MᏫᎻᎯᎷᎷᎬᎠ
Yeah
Daniele°
I doubt that you can compile any C++ in C#
I doubt than you can compile any C in C++
MᏫᎻᎯᎷᎷᎬᎠ
You are right
MᏫᎻᎯᎷᎷᎬᎠ
C++ is stronger in typing
BinaryByter
thats why I say that calling C++ a superset of C is highly moronic
Daniele°
i said int *a = malloc (10);
This don't build on C++
BinaryByter
Anonymous
BinaryByter
Daniele°
And C++ isn't a superset of C
MᏫᎻᎯᎷᎷᎬᎠ
🐰🐾 سمیه
BinaryByter
BinaryByter
What's that
Don't worry about it
Daniele°
What's that
Other language same C#
Daniele°
google what a superset is
susperset is an adversing create by stroustrup
MᏫᎻᎯᎷᎷᎬᎠ
google what a superset is
superset [′sü·pər‚set] (computer science) A programming language that contains all the features of a given language and has been expanded or enhanced to include other features as well.
Daniele°
exactly
But Ritchie he has repeatedly reminded stroustrup not to say bullshit
MᏫᎻᎯᎷᎷᎬᎠ
BinaryByter
MᏫᎻᎯᎷᎷᎬᎠ
Whatever It's useless topic
BinaryByter
MᏫᎻᎯᎷᎷᎬᎠ
ALL
Yeah I know E != V
MᏫᎻᎯᎷᎷᎬᎠ
You claimed it
That was not running away
BinaryByter
Yeah I know E != V
No, in this case we use the symbol C ⊄ C++
Pavel
There are actually some crazy features, that C has that are missing in C++ (crazy, because I'm not used to it, of course). I work with a guy who is talking about such features every time he has a chance :)
BinaryByter
What I miss most in C++ from C is the feature of int a = <>; int b[a];
BinaryByter
honestly, its so convenient - especially in kernel dev
Mihail
BinaryByter
In C, we have to hack it together with int b[1];
Mihail
Btw in C++ you could simply use an alloca
Mihail
VLAs?
Variable length arrays
MᏫᎻᎯᎷᎷᎬᎠ
Anything
Define anything
Mihail
Define anything
Any integer
MᏫᎻᎯᎷᎷᎬᎠ
MᏫᎻᎯᎷᎷᎬᎠ
A variable that hold any integer?!
Mihail
What?!!
He just put that there to illustrate that there's some value
MᏫᎻᎯᎷᎷᎬᎠ
What kind of shit that?!
Mihail
Just put 10 if you want
BinaryByter
but what i mean about int*b[a]; is that b is expressed to have a elements
BinaryByter
if I do int*b [1]; I will have to comment somewhere how much data it can actually hold
MᏫᎻᎯᎷᎷᎬᎠ
BinaryByter
This might seem irellevant normally, but in kernel dev, since you don't allocate anything, it doesnt matter
MᏫᎻᎯᎷᎷᎬᎠ
No
Then It'll cause ub
Mihail
Then It'll cause ub
It won't compile lol
BinaryByter
Wdym comment?
int *b[1]; //is meant to hold 100 ints
BinaryByter
int *b[1]; //is meant to hold 100 ints
or for sake of this argument //is meant to hold a ints
Mihail
Simply int *b = std::alloca(a);
BinaryByter
Simply int *b = std::alloca(a);
yes, but in kernel dev that doesnt exist
Mihail
Well yea
BinaryByter
also, in some scenarios you might want the array to start at pointer n, but you don't know how long it will be
MᏫᎻᎯᎷᎷᎬᎠ
Just think about it
I dunno kernel dev
BinaryByter
Just think about it
no, this concept might be hard to get for beginners
BinaryByter
in kernel dev, every byte of ram is yours to have