Asad
std::vector is not a linked list implementation.
Anonymous
im not sure, have not worked with C++ in a few months
Anonymous
also void * is just abusal of the type system
while it CAN hold any type, it is recommended to use std::any as it is type safe (mostly), otherwise cast checking will need to be done
Anonymous
however void * is useful when the type is unknown or if you dont want to expost the type and instead pass it to an underlying api (or pass it to an api that accepts void * and just have it do type checking, casting and such for you)
Anonymous
which im not sure if std::any can handle the same way in terms of void * assignment and casting
Anonymous
since std::any<void> would be illegal, and im not sure if std::any unknown = reinterpret_cast<void*>(&data); is valid
Igor🇺🇦
Anonymous
Anonymous
tho there are loads of other std containers so its easy to get confused xP
Anonymous
imma just throw these xP
https://en.cppreference.com/w/cpp/container/vector
https://en.cppreference.com/w/cpp/utility/any
Asad
Pavel
What is the purpose of std::any?
std::any can contain anything, so it stores the value on heap for "not small" objects, std::variant knows the size of the biggest possible value that can be stored, so it can store everything on stack, std::tuple knows the exact types on compile time so it stores it on stack and packed as if it was a struct.
In simple words, std::any is a safe and handy version of void* from C, std::variant is a safe and handy version of tagged union. Tuple is a "templated struct" that can be inspected by templated code (if you are not going to use it in templates, better to create a struct).
Anonymous
Hey could some one explain to me how to write this properly?
Anonymous
#include < iostream >
using namespace std;
int main ( )
{ cout<<" Hello my name is Weba !!"
return 0
}
Anonymous
Something feels off about it
Asad
missing semicolons ( ; )
Anonymous
Ooh okay but I also tried fixing that and then it said that the iostream library didn't exist
Anonymous
#include < iostream >
using namespace std;
int main ( )
{
cout<<" Hello my name is Weba !!"
return 0;
}
Asad
Anonymous
Ooh okay thanks. I'll try it out
Anonymous
Truth
Guys What are the applications of this pointer? can someone explain?
Pavel
Guys What are the applications of this pointer? can someone explain?
You can use this to give some other class pointer to yourself.
For example, you need to run some routine and want it to be able to call a function of your class when it finishes, you can subscribe to it using a pointer to the method and this, and then the routine will know what object it needs to call this method on when it is done. (there are more details for it to work, I skipping them here)
Truth
Anonymous
Hi guys
Anonymous
Hope y’all good
Arm
I changed the project (C# Windows Form) and got a database access error:
The provider "Microsoft.Jet.OLEDB.4.0" is not registered on the local device.
To solve this problem, I have to change the platform from "Any cpu" to "X86".
I made this change, now the question is:
Is it okay if the project runs on any system with any platform (32 or 64 bits)?
MAC
Arm
i just change "platform target" from ANY CPU to X86.
Arm
so, my project can be run in any pc with any cpu?
example: my pc is X64bit, another pc is X86bit.
Pavel
Arm
Pavel
so my project can be run.
As far as I know it should be fine, unless it needs big amounts of RAM (3Gb+) in order to work
Arm
Mansi
#who_can_do?
5x + 2y - 2z = 3
x - 3y + z = -16
x - y + 8z = 16
assume (x0 =y0 =0=z0)
produce c++ program by Gaoss Siadel method.
ES = 0.00001
Mansi
S__R
Anonymous
Hey, I am a community manager of the SparkySpot platform, where you can set career development plans. Now we launch beta and looking for the first users. We are searching for leads, HR, managers, and everyone who needs improvement in the team development process. If you are interested and ready to help, contact me for a short demo call.
P.S. Maybe you know someone who might be interested in it?
Looking forward to your response!
S__R
🕸 03xploit 🕸
Hi guys
I want to get os version (32/64bit) using with c++
Can anyone help me ??
MAC
MAC
Vlad
⚛ Hz
x64 cpu can run in 32bit mode, and windows provide a compatibility layer for 32bit windows api (aka wow64
⚛ Hz
(bonus: windows arm version also support emulate x86, also for the windows api ( aka WowARM64) Technically speaking, x86 programs are “universal” for windows platform, although it is an inefficient way
⚛ Hz
X86 = x32
In some contexts, x32 refers to different meanings https://en.wikipedia.org/wiki/X32_ABI
س💕 ⚖️
l want to collect the odd numbers alone and ,collect the even numbers alone, how?
س💕 ⚖️
Please can you help me ❤️
J
if odd then ... else ...
س💕 ⚖️
How do I make only individual numbers appear in the print function or wife I don't want them all
س💕 ⚖️
int odd (int n,int m);
int even (int n,int m);
//int evnodd (int num1,int num2);
int main() {
int i ,j;
printf (" enter number two number and i will check these numbers \n");
scanf("%d%d" ,&i,&j);
int r1 = odd (i,j);
int r2 = even(i,j);
printf ("the sum odd is %d\n",r1);
printf(" the sum even is %d\n",r2);
return 0 ;
}
int odd (int n,int m){
if (n %2==1&& m %2==1){
int sum ;
sum =n+m;
return ( sum);}
}
int even (int n,int m){
if (n %2==0&& m %2==0) {
int sum = n+m;
return(sum);}
}
س💕 ⚖️
Where do I put the print function ؟
س💕 ⚖️
Anonymous
Can someone please suggest me from where I must learn hardware and software interfacing programming in c/c++ language
🕸 03xploit 🕸
MAC
robherc
MAC
.
Who can help me I'm 17 but I don't about programming who can teach me the basics
𝚕𝚊𝚒𝚗𝚋𝚘𝚝.𝚜𝚌𝚖 🇺🇬
Anonymous
/getbooks
Anonymous
#freeprogrammingbooks
Anonymous
#freeprogrammingbooks
Anonymous
/get bro
Anonymous
/get best-book
Anonymous
/get learn
Anonymous
/get learn
MAC
/get admin
MAC
/get info
MAC
/get help
MAC
Hatch
MAC
/get hello