The
not even a huge amount of data.. this like 1000 mesgs/sec lol .. i wonder if it's due to lower rate.. idk for now
Anonymous
I don't care
🙊 but np
Anonymous
Also anyone got groups for assembly and malware analysis
Light
What is the key difference b/w visual studio and vs code
Harshadbhai
What is the key difference b/w visual studio and vs code
Visual Studio only runs on macOS and Windows. VS Code can run on macOS, Windows as well as Linux. Not many professionally developed plugins are available for Visual Studio. VS Code comes with a wide range of professionally curated plugins and extensions to meet all kinds of editing and compiling needs.
Light
Then why people yse VS
Light
*use
𝔖𝔞𝔯𝔬
What is the key difference b/w visual studio and vs code
Vs code is a light weight code editor that has a large ecosystem of extension visual studio is and ide, it supports different languages by fefualt (i use it only for C++ or C#), honestly the only worth ide for C++,
Light
Uh, sorry
klimi
Uh, sorry
wasn't that bad, np
klimi
Doesn't seem lightweight at all for a code editor
if you don't add any extensions...
Tokin
if you don't add any extensions...
Why use a browser at all tho
klimi
Why use a browser at all tho
why use a program at all tho
Tokin
Fair but if it advertises itself as lightweight, and if one is really concerned about performance, I don't think VS code would be falling into that category
Tokin
But well you are right.. It's just a tool.. So nvm
Hasna
foo(string const& myname) more advantage than foo(string const* myname) relating to null refererence. Can somebody explain me ? foo(string const& myname) vs foo(string const &myname) does the same thing ?
Light
& myname And &myname both are same, space doesnt create any difference that is how the language works
Light
Heay, btw i havent heard any null reference, i have always used nullptr, is null reference even valid?
borealis
int* p = nullptr; int& r = *p; std::cout << r; yep null references dont exist
borealis
it compiles, links, and runs, what do you mean
Danya🔥
it compiles, links, and runs, what do you mean
It doesn't mean it's valid lol
borealis
define valid
Danya🔥
define valid
Conforms to the C++ standard
borealis
which line does not conform to the standard?
Danya🔥
which line does not conform to the standard?
Reading the dangling reference
Danya🔥
It's undefined behavior
borealis
oh ok sorry int* p = nullptr; int& r = *p; r is still a null reference
Victor
It's undefined behavior
Show me the line is standard where its described
Danya🔥
Danya🔥
oh ok sorry int* p = nullptr; int& r = *p; r is still a null reference
It's not a null reference, it's a dangling reference
Victor
Pointer is run-time variable, you can not have a knowledge about will it be a null or not
Danya🔥
How does it make a C++ program valid or not?
Victor
Thats another question
Danya🔥
Thats another question
What question have you answered then? :)
Danya🔥
.
Dude, when you're trying to read an object which lifetime has not started, it is undefined behavior Is that so hard to understand?
Danya🔥
One example in the standard of that would be: http://eel.is/c++draft/basic.life#7
Anonymous
Show me the line is standard where its described
dcl.ref/5 Note: in particular, a null reference cannot exist in a well-defined program, because the only way to create such a reference would be to bind it to the “object” obtained by indirection through a null pointer, which causes undefined behavior.
borealis
int a += b; yep this also has undefined behavior
Danya🔥
int a += b; yep this also has undefined behavior
The code itself is invalid just like its author
borealis
bruh you got me there what about this int a, b; // ... a += b; undefined behavior
aronCrow
It's a random number generator
Victor
bool b; is also some kind of qubit
Victor
Also depending on compilers optimizations
Danya🔥
bruh you got me there what about this int a, b; // ... a += b; undefined behavior
I'm not sure, probably it is also undefined behavior http://eel.is/c++draft/basic.indet#2
borealis
I'm not sure, probably it is also undefined behavior http://eel.is/c++draft/basic.indet#2
I was trying to talk about another type of UB other than indeterminate values, imagine a and b being initialized later on something like this int a, b; a = 2000000000; b = 1000000000; a += b;
Danya🔥
int* answer = (int*)malloc(sizeof(int)); *answer = 42; This is also undefined behavior before C++20 :) But it behaved as expected on all the implementations because otherwise it would be a nightmare for the C and C++ compatibility In C++20 they added a wording that malloc and some other functions implicitly start a lifetime for some types of objects
Danya🔥
For some inputs it does have an UB, for other - does not
borealis
classic c++ be careful with your c++ everyone, c++ tends to bite you when you least expect it
VD
For some inputs it does have an UB, for other - does not
You are right. Using uninitialized variables to initialize other variables is generally Undefined Behavior. There are exceptions only for char (if it is unsigned char on the implementation), unsigned char and std::byte.
Danya🔥
Isn't casting value that malloc returned bad practice ?
If you do not do the cast, the code is not going to compile in C++
imminent
even in c you should cast it
\Device\NUL
even in c you should cast it
https://stackoverflow.com/questions/605845/do-i-cast-the-result-of-malloc
imminent
those points are retarded in that post
imminent
It is unnecessary, as void * is automatically and safely promoted to any other pointer type in this case. well now have fun importing the code to a c++ project It adds clutter to the code, casts are not very easy to read (especially if the pointer type is long). what clutter, if you name ur shit with long ass names, you have other issues It makes you repeat yourself, which is generally bad. blah blah blah, sometimes repeating yourself is better It can hide an error if you forgot to include <stdlib.h>. This can cause crashes (or, worse, not cause a crash until way later in some totally different part of the code) your code won't compile congrats
Light
What is the best way to make cpp GUI applications
Ziky
What is the best way to make cpp GUI applications
C'mon be an engineer. It depends at least on platform and complexity of that app.
aronCrow
What is the best way to make cpp GUI applications
If you really want to go with other's opinion, use qt