Vlad
But if you don't know your standard than it's obviously a default one
Vlad
Which will be c++14 I presume
Vlad
How to know in VSCode
Add that flag to your build script
Prince Of Persia
I will check by register keyword If I can use register keyword so I have older that 17
Vlad
Why so obscure? :D
Prince Of Persia
😁 funny way
Prince Of Persia
Can I use void* safe?
Vlad
Can I use void* safe?
You can if you cast to the proper type
Igor🇺🇦
Can I use void* safe?
Why would you? You have templates, variant, any - etc.
Vlad
But it's extremely error prone
Vlad
You can easily bust your leg off 😁
Prince Of Persia
Why would you? You have templates, variant, any - etc.
a pointer for anything Why not use? I want to use variant but variant is too large
Prince Of Persia
Vlad
And it's not meant for polymorphism
Vlad
Templates are the jam
Prince Of Persia
My variant length is 96 Byte
Igor🇺🇦
a pointer for anything Why not use? I want to use variant but variant is too large
You shouldn't use pointers unless you have to and especially use pointer to "anything"
Vlad
My variant length is 96 Byte
What's your class size that you put into the variant?
Vlad
It shall be of the size of the biggest type of that variant
Vlad
The same way as union
Vlad
Cause it's meant to replace it
Prince Of Persia
What's your class size that you put into the variant?
Dynamic classes like boost cpp int boost dec float and std::string
Prince Of Persia
Igor🇺🇦
My variant length is 96 Byte
What software are you working on that it makes a difference?
Vlad
Amd64 Ubuntu
He meant your own software memory footprint constraints
Prince Of Persia
If I use 11 vars of my class It will be more than 1 KB
Vlad
So?
Prince Of Persia
It isn't good at all
Vlad
So you want to have a lot of bigints packed into variants?
Prince Of Persia
Using pointers for each classes is much better in my class Like using pointers for these three classes it will take 8*3=24 bytes and i can delete pointers or ... To get free memory
Igor🇺🇦
Amd64 Ubuntu
Your pointer is 64 bit, even if variants adds 32 bits in exchange for type safety - I'd go with type safety every time. How many variants do you want expect? Billions?
Vlad
I'm sure you're having a XY problem
Vlad
And mallocing each thing is worse than having extra on the stack
Prince Of Persia
Memory has to be allocated anyway
But using much memory isn't good at all
Prince Of Persia
To create some variables like what python have
Prince Of Persia
And imagine how much var in python are in use
Igor🇺🇦
But using much memory isn't good at all
Pointer + object that it points to will consume more memory
Vlad
And imagine how much var in python are in use
It doesn't make sense unless you're doing an interpreter
Prince Of Persia
Pointer + object that it points to will consume more memory
But I want to use this cpp_int* i=0; cpp_float* f=0; std::string* str=0; In this case I can just use one pointer and delete all others have So better in size
Vlad
And guess what it eats up memory
Prince Of Persia
What to do now?
Anonymous
What to do now?
look for a princess
Vlad
Lolwut
Prince Of Persia
Lolwut
Translate my name
Vlad
What to do now?
You can either have your own hacky implementation or trust an existing one
Vlad
Translate my name
Sorry I don't know arabian
Vlad
And not bothered to google translate either
Prince Of Persia
Sorry I don't know arabian
It's Farsi means prince of persia
Vlad
Now I get it thx
Anonymous
Greetings to all Please am new hear And. I really want to learn cpp So where can I start
Igor🇺🇦
What to do now?
I think for someone who doesn't know what C++ standard they use and the size of problem domain (many many variables is not well defined) you're concerning yourself with wrong issues. Implement something that works optimise for every last bit later if needed. Algorithms that you use will have much greater impact than difference in size between pointers and variants.
Jaydeep
Hi, friends hope you're having a great day! I am working on an app where I am using socker.io and express module in the backend. But now I want to use rest API for some scenario and syn it with socket.io for example: Suppose if a client name Tom wants to join a chat room, So Tom sends a request using the rest API route "domainName/joinroom" and the server gets that request now the server will first validate the request and then join the room. However, in order to join the room, the server needs the socket object that can connect Tom to the chat room. In order to get that specific socket object, the request must send using socket.io and I am trying to avoid that. if you guys faced the same situation, please comment a reference code or send a link related to this problem.
Bh@iR@m
What is difference b/w System and user software?
Ausir
Hi guys, I'm wondering: have I to detach my shm segment before deleting it by shmctl? Can I use shmctl IPC_RMID without shmdt?
PaAaAria
Cppdroid on play store🐲
Thx for your suggestion Do you know where the files will be saved in this IDE? I used ofstream command but I don't Know whether the file is created or not
Anonymous
Don't you have a pc? Coding on a phone is a torture.
Neeeh it's fine here just disable the autocaps hahaha
Anonymous
Anonymous
Where is "here"?
Here is my phone xD
Anonymous
Igor🇺🇦
Here is my phone xD
You have a tiny screen, no proper keyboard, no proper multitasking and you have to hold your phone all the time. No, it's not fine. Any crappy PC, as long as it can run a modern desktop OS and have several GB of ram to spare for coding is better. It doesn't have to be latest and greatest model to beat a phone experience
Anonymous
Tiny screen cant beat it
Hadi A
Hello everyone i am new to programming i wanna start learning c programming anyone knows a good course/book that explains everything from beginner to advanced?