Jussi
also http://harmful.cat-v.org/software/c++/
Anonymous
Can't C be equivalently be replaced by cPP to provide the same speed.
Anonymous
?
Dima
these are retarded questions
Stephanos
Stephanos
Waiting for people to be triggered
Stephanos
Okay, i'll Just Provide the Link :P
My coworker and me build a lib for embedded targets, that outranks all C libs, performance-wise, due to TMP optimizations. Compiletime goes Up, runtime goes down
Stephanos
https://www.electronicdesign.com/dev-tools/evolution-special-function-register-abstraction
Stephanos
¯\_(ツ)_/¯
Sachin
#include<iostream>
#include<list>
using namespace std;
int main(){
int i,n,data,name;
list<pair<int,string>> l1;
cin>>n;
list<pair<int,string>>::iterator ptr;
for(i=0;i<5;i++){
cin>>data>>name;
l1.push_back(data,"name");
}
return 0;
}
Is it correct way to insert data in list of pairs?
Rostin
Does anyone know how to force close a SSL connection ?
Jobin
How to traverse through all the files in an input directory in Windows
Dima
open folder and scroll through.
Dima
use dirent.h
Dima
or you can use std::filesystem
Dima
Anonymous
can anyone explain how does this work:
int main(){
int x;
x=1,2,3;
}
Anonymous
what type of initialisation is this?
Stephanos
Ariana
c is like easier to use when say analysing a source, or like trying to control exactly where things are in memory
also c++ libraries are quite heavy for like tiny devices
Ariana
sometimes there isn’t rlly a difference between c++ and c except struct vs class, then both are perfectly ok imo, would depend on what you’re more comfortable with
Dima
Ariana
i rarely actly c++ 👀
Malevolent
Enum classes vs enum
Which is more efficient?
Dima
none, it’s just cleaner in a code
Malevolent
So there's no difference?
Malevolent
Like none at all??
Victor D.
enum class is the new way of declaring enums as far as i know
Victor D.
it was introduced in the c++11 standard
Pavel
Malevolent
Victor D.
Doing some research (i just #googleit) i've found that there is a difference regarding type safety. Is that you can convert plain enums to int and viceversa, but if you try to do so with a enum class the compiler yields an error
Dima
you can cast them to int haha
Victor D.
enum classes?
Dima
yes. and inherit enums from a basic integer types
olli
enum classes?
You can cast them explicitly (static_cast), enum classes can't be casted implicitly.
However, this has no impact on the performance
Victor D.
Victor D.
I'm not used to use enum classes, i always use plain enums
Malevolent
Dima
Victor D.
i put then as a public property in a class
Dima
I mean enum items
Victor D.
class State{
public:
enum Trigger
{
OFF, ON
};
State()
{
this->state = ON;
}
virtual ~State()
{
}
virtual void Present() = 0;
virtual void HandleEvent() = 0;
virtual void OnEnter() = 0;
virtual void OnExit() = 0;
virtual void ChangeStateTrigger(Trigger state)
{
this->state = state;
}
virtual Trigger GetStateTrigger()
{
return this->state;
}
private:
Trigger state;
};
Victor D.
Something like this
Victor D.
Then i can refer to the enum items as State::ON and State::OFF
Pallavi Bharati
Thanks ✌ yeah I read..🙂
Anonymous
Getting a error undefined reference to winmain@16 while creating a simple window of 32 bit. I tried googling but can't find anything🤨
Dima
it’s the obvious one
Dima
set your app type to a console application or implement WinMain method instead of main()
Anonymous
ok lemme try
Anonymous
it worked
Anonymous
But what what the problem earlier?
Anonymous
thanks btw ☺
james
Anyone one with pdf Concurrency with Modern C++. Help
MᏫᎻᎯᎷᎷᎬᎠ
MᏫᎻᎯᎷᎷᎬᎠ
I can't send pdf
james
MᏫᎻᎯᎷᎷᎬᎠ
Neither my connection can
MᏫᎻᎯᎷᎷᎬᎠ
Dima
Dima
MᏫᎻᎯᎷᎷᎬᎠ
Do you mean which format I can send?!
MᏫᎻᎯᎷᎷᎬᎠ
I can't send it with any format
MᏫᎻᎯᎷᎷᎬᎠ
Go and get it with some way
Avijit
Anonymous
Guys ,
When will I ever need to use binary in a code
Cause as a new developer I don't see the use of binary or hex in a code?
What reason will I have to use binary numbers of hexadecimal in my code.
Please help
Dima
you would need to use hex rarely but not binary, this is retarded. where did you get this information?
Anonymous
Someone was saying something about sending information to a binary what what using a binary number
Anonymous
Dima
no, read my message again
Anonymous
Oh a hex sometimes never binary
Anonymous
I am right
Vladimir
Hex was invented to not read long numbers of base 2, 8, 10 and used in addressing memory
Anonymous
Ok
Vladimir
Usually word 'binary' refers to binary files, mean not human readble text files
Anonymous
Yeah I know sir
Anonymous
So a guy said you can send info to binary files
Anonymous
If it is true how
Anonymous
Then why would I do that