Anonymous
vim ai on: struct *bar foo(struct bar *foobar) { if (!foobar) foobar = malloc(sizeof(struct bar)); return (*bar)foobar; }
Manuel
sorry.. indented you can see better
Anonymous
sorry.. indented you can see better
Seriously, I don't understand unindented code 😷
Manuel
seriusly.. i don't know how indent with my android
Manuel
xD
Anonymous
or quickedit :)
Manuel
i will try it
Alignant
Which is sad
Anonymous
Yes
Manuel
Shashank https://ptpb.pw/3NTg/c
Hikigaya
👍
Anonymous
Big o notation
klimi
Yes
Alignant
Big o notation
I can't argue with it
klimi
It's 72n
See
How to assign the memory address of a vector char v[50][50] to a double pointer char **p
Anonymous
How to assign the memory address of a vector char v[50][50] to a double pointer char **p
use pointers to pointers that points to pointers that pointes to another pointer that points to another one and so on :)
Manuel
you're welcome
Manuel
😄
Anonymous
😊
Mat
And v[50][50] is an array, not a vector
BinaryByter
He means pointercasts i think
Alignant
He means pointercasts i think
char[50][50] is a type, and char[49][49] is another type vector is dynamic and has a type vector<char>, not vector<char[50]> You could make a vector of char[50], but why? :c
BinaryByter
How about we ignore questions that don't provide enoufd context?
BinaryByter
Btw : my code isn't working can anybody tell me why? Pls sir!
Alignant
Or are you making a stupid question
Alignant
To show an example of a stupid question?
BinaryByter
Same problem?
I've given up, ill refactor the rest of tde code and figure that shit out later
Alignant
Lol
Alignant
#include <iostream> #include <vector> int main() { std::vector<std::vector<char>> vec{{'1', '2', '3'}, {'6', '5', '4'}}; int l1 = vec.size(); int l2 = vec.data()->size(); char** ptr = (char**)malloc(l1); for(int i = 0; i < l1; i++) ptr[i] = vec[i].data(); for(int i = 0; i < l1; i++) { for(int j = 0; j < l2; j++) std::cout << ptr[i][j] << " "; std::cout << "\n"; } std::cout << std::endl; free(ptr); return 0; }
Alignant
Result: 1 2 3 6 5 4
Alignant
Don't laugh, the request is more stupid than the code xD
BinaryByter
Result: 1 2 3 6 5 4
Doesn't rely on any input so just hardcode the outputs
Kalpesh
Kalpesh
x1 ans are not showing display
Kalpesh
-nan
klimi
yeah
klimi
its right
klimi
its working right
klimi
so its NaN
klimi
doesnt have roots
klimi
Not a Number
Anonymous
Anyone knows any accredited online computer programs?
Anonymous
Thank you
Manuel
doesnt have roots
he has to put a conditional before make SQRT: if ((b*b-4*a*c) < 0) { SQRT * -i}
Anonymous
Heyyyyy...... Does anyone know how i can convert php to html en css3
Bader
hey guys, a bit of confusion
Bader
a uint64_t is the same as saying uint8_t a[8]; right ?
BinaryByter
memory map wise, yes
Bader
alright. what would be the advntage of one over the other?
BinaryByter
the one is just an array of numbers the other is a number
Bader
ahhh okay, so uint64_t iwould be 123456788 and `uint8_t a[8] = {12345678, 12345678 etc};` ?
Bader
cuz ascii values right?
BinaryByter
but you can reinterpret cast the array to a uint64_t
Bader
or what?
BinaryByter
cuz ascii values right?
8 bits can only hold 256 states
Bader
8 bits can only hold 256 states
what do you mean when you say states?
BinaryByter
a state
BinaryByter
either on or off
Anonymous
I also try
Bader
oh ok lol 😂
BinaryByter
either on or off
those are the two states of a bit
Anonymous
Ok lol
BinaryByter
two bit can have four states already
Bader
1 or 0 hehe
BinaryByter
Anonymous
1
Bader
those are the two states of a bit
yea i understand thanks