Asad
std::vector is not a linked list implementation.
Anonymous
std::vector is not a linked list implementation.
well it has members that make it similar to one, such as push_back, and pop_back (may be from std::deque ?)
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
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
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; }
Anonymous
Ooh okay thanks. I'll try it out
Pavel
#include < iostream > using namespace std; int main ( ) { cout<<" Hello my name is Weba !!" return 0; }
You shouldn't put spaces after < and before > in include statement, otherwise it will try to search this name with the spaces " iostream "
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)
Anonymous
Hi guys
Anonymous
Hope y’all good
Ammar
#ASK #x86_64 #AVX512 Good day everybody, I am studying AVX-512. I have a question about VORPS. The documentation says like this: EVEX.512.0F.W0 56 /r VORPS zmm1 {k1}{z}, zmm2, zmm3/m512/m32bcst Return the bitwise logical OR of packed single-precision floating-point values in zmm2 and zmm3/m512/m32bcst subject to writemask k1. EVEX encoded versions: The first source operand is a ZMM/YMM/XMM register. The second source operand can be a ZMM/YMM/XMM register, a 512/256/128-bit memory location, or a 512/256/128-bit vector broadcasted from a 32-bit memory location. The destination operand is a ZMM/YMM/XMM register conditionally updated with writemask k1. Ref: https://www.felixcloutier.com/x86/orps What does "subject to writemask k1" means? Can anyone give a concrete example of k1 contribution in this instruction? I wrote this code to do some experiment about VORPS. https://godbolt.org/z/r78a16 Here, I tried to change the value of k0, k1, k2. But the result is always the same. Result: 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03
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)?
Arm
i just change "platform target" from ANY CPU to X86.
Arm
Did you change your hardware in order to launch a program ?
Sorry, I wanted to write "change", I did not mistakenly "chane".
Arm
so, my project can be run in any pc with any cpu? example: my pc is X64bit, another pc is X86bit.
Pavel
so, my project can be run in any pc with any cpu? example: my pc is X64bit, another pc is X86bit.
Afaik x64 systems are back compatible to x86 (it's not 86 bit)
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
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
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!
Mansi
make a matrix multipication program
its not run & not give the output I send you the program, you we check?
🕸 03xploit 🕸
Hi guys I want to get os version (32/64bit) using with c++ Can anyone help me ??
Wojak
Hi guys I want to get os version (32/64bit) using with c++ Can anyone help me ??
void print_os_info() { OSVERSIONINFOEX info; ZeroMemory(&info, sizeof(OSVERSIONINFOEX)); info.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX); GetVersionEx(&info); printf("Windows version: %u.%u\n", info.dwMajorVersion, info.dwMinorVersion); }
⚛ Hz
Hi guys I want to get os version (32/64bit) using with c++ Can anyone help me ??
Since 64 bit program cannot running under 32bit system, so you can detect it by https://docs.microsoft.com/en-us/windows/win32/api/wow64apiset/nf-wow64apiset-iswow64process or another api https://docs.microsoft.com/en-us/windows/win32/api/sysinfoapi/nf-sysinfoapi-getnativesysteminfo
Vlad
?
x64 runs x86 code
⚛ 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
robherc
Can someone please suggest me from where I must learn hardware and software interfacing programming in c/c++ language
depends on what hardware you're trying to interface with. I generally start with the datasheet.
MAC
Can someone please suggest me from where I must learn hardware and software interfacing programming in c/c++ language
I don't know for certain Tannenbaum or Tanenbaum , he has the best book about hardware
.
Who can help me I'm 17 but I don't about programming who can teach me the basics
𝚕𝚊𝚒𝚗𝚋𝚘𝚝.𝚜𝚌𝚖 🇺🇬
Anonymous
/getbooks
Anonymous
#freeprogrammingbooks
.
books are a good place to start
Can you tell me which one is better
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