Anonymous
And I will replace 0 to 1 then what happen
V01D
Really?
Anonymous
Hui
❤️
Vlad
Correct way is to use a !
It doesn't matter. Even more so, == 0 makes your intention more clear.
Anonymous
And I will 1 then
Vlad
'Cause one might think !strcmp() means non equality
Vlad
And I will 1 then
pls google strcmp I beg you
Anonymous
I'm the function of strcmp
Anonymous
I'm the function of strcmp
Hi function of strcmp, I'm @clannad
V01D
No
I get a compile error using: if (cond) ( // )
Anonymous
It is use for comparison
V01D
Yeah, I know. I meant the () need to be {}
V01D
He used () twice.
Anonymous
V01D
if (cond) //yes () //No, must be {}
Vlad
Also shouldn't if()() work for a single line?
V01D
Rip.
Vlad
Didnt compile for me
I guess you could do this :P if(cond) (void) ( // );
Pavel
Anonymous
It's is command line argument
silver
Hey guys I'm building a data compression algorithm in c++ any tips
Vlad
Does not look like a valid syntax
https://godbolt.org/z/aKToMe It works :P
V01D
Vlad
; must be after the bracket
Anonymous
+1
Anonymous
if (a == b) (void) (printf("a"));
Anonymous
https://godbolt.org/z/aKToMe It works :P
Well it's a weird syntax
V01D
Oh you left the ; away for printf
Anonymous
It works because the there's only one statement following the if
Anonymous
So you can drop the {}
Vlad
Well it's a weird syntax
It's for lulz only :P. And sometimes useful in macros.
silver
Put ";" instead of ") "
V01D
C is always good for a suprise, ig
silver
So now help me guys I need tips on how to build a data compression algorithm
V01D
if (a == b) (void) (printf("a"));
How does that even work, just by casting the following to a void type? Like is it even a conditional statement then?
Vlad
So it's execution only in a way.
V01D
Oh, ok
V01D
Thanks
Anonymous
Bann him back door
Anonymous
How does that even work, just by casting the following to a void type? Like is it even a conditional statement then?
casting to void turns the expression into a void expression, suppressing any warnings. for example - you can use that with printf(), which returns the number of characters printed, when warn on unused return value is enabled. omitting that, the snippet becomes - if (a == b) (printf("a")); the parentheses are superfluous. and so - if (a == b) printf("a");
V01D
Thank you ^^
olli
V01D
The new keyword is only for C++, not C right?
V01D
Because I am using a libray for C code, written in C that uses the new keyword. I get a compiler error, it doesnt know what new is.
V01D
Here is the lib: (the first code sample is where I can't continue) https://github.com/berndporr/kiss-fft
silver
Why not using an existing one? LZMA is pretty good
Coz I have one that will work better than that one.. I have the mathematics (I'm working on a special thesis on an unestablished branch of mathematical and its best demonstrated in data compression.. I have the algorithm but I just don't know where to start in coding it yet)
Igor🇺🇦
Coz I have one that will work better than that one.. I have the mathematics (I'm working on a special thesis on an unestablished branch of mathematical and its best demonstrated in data compression.. I have the algorithm but I just don't know where to start in coding it yet)
You're asking "how to build data compression algorithm". It seems that you don't have one yet. Building new compression algorithms is not related to C/C++ group. You need to have one before starting coding anything
silver
You're asking "how to build data compression algorithm". It seems that you don't have one yet. Building new compression algorithms is not related to C/C++ group. You need to have one before starting coding anything
I repeat I already have an entire paper I'm soon to publish on the methods and steps that need to be used if you need to code for one... So far it's in charts, equations and words... I want to turn it to code preferably C++ that's why I asked for tips
Igor🇺🇦
Here is the lib: (the first code sample is where I can't continue) https://github.com/berndporr/kiss-fft
Why are using both "free" and "delete" ? You should never use both. If you're using C++ use delete/new only, if you use C use malloc /free only. Don't mix them together
silver
Pulling this off will get me a gate pass to the PhD program at my university.
Igor🇺🇦
I repeat I already have an entire paper I'm soon to publish on the methods and steps that need to be used if you need to code for one... So far it's in charts, equations and words... I want to turn it to code preferably C++ that's why I asked for tips
What tips do you want? If you have an algorithm go and implement it. Show in what way your algorithm is better. Is performance? Is it compression? Who knows what your algorithm does except you? 🤷‍♂️
silver
What tips do you want? If you have an algorithm go and implement it. Show in what way your algorithm is better. Is performance? Is it compression? Who knows what your algorithm does except you? 🤷‍♂️
Igor if you ain't going to help its better you ignore me coz you are being rude right now... I get the fact that you feel you are a super master coder and anyone whose is not at your level is trash.. Nice attitude bud... I guess that's why you are a muti millionaire / billionaire rn 😊
Dima
lol
silver
I don't argue with tech maguls... I'm technologically illiterate... I wouldnt stand a chance coz they run super tech businesses and drink beer with Bill Gates and Mark Zee .. Makes me wonder where they get time for telegram and to argue with me with such a busy schedule and all.
Dima
if you have such questions, you’ll never become a dev lol
Dima
Dima
just simply read into allocated byte array
Dima
use fread for C
Dima
is binary data structure known?
Dima
you may need to read its header first, get length and fread then.
Dima
use fseek to end and ftell to get file size