Anonymous
For what purpose -> is used in c++
Anonymous
For what purpose -> is used in c++
Please admins clear my doubt
I_Interface
Please admins clear my doubt
overloaded "." operator for object
Anonymous
overloaded "." operator for object
I am asking about use of -> My teacher said that it is used by pointer to access elements of structure
Anonymous
U can use it for pointers to ur objects
Can you give an simple example of code
Anonymous
object->method() is the same as (*object).method()
What happened here I didn't get can you explain it A pointer is working as object 😵😵😵😵
Francisco
What happened here I didn't get can you explain it A pointer is working as object 😵😵😵😵
The operator-> dereferences the object and access its methods/attributes
I_Interface
What happened here I didn't get can you explain it A pointer is working as object 😵😵😵😵
it's a pointer to object and u can use it to call a method of this object in memory
Francisco
The example I gave you is simple enough to understand it
I_Interface
The example I gave you is simple enough to understand it
I think he needs to learn about memory allocation 🤔
Francisco
Yep, I think so
klimi
What a fuck😅
what? wanna appeal?
Timothy
😁😁😁
Renan
I want to learn c/c++
Are you new to programming in general?
.........
@LearnJavaCoding best to learn java code
01000001011011010100000101101110
/report
Raz
/report get out
😂😂😂
Kenneth
Hey everyone
Kenneth
Whats the difference between std::move and std::swap?
Kenneth
The implementation look very much the same to me :(
Ghost🔥
😂😂😂😅
Artöm
The implementation look very much the same to me :(
Fucking not. Completely different things
Artöm
Have you read descriptions?
Pavel
Whats the difference between std::move and std::swap?
std:swap swaps objects, std::move casts the variable to rvalue reference
Pavel
So completely different tasks, producing different results
Kenneth
i dont really understand r-value reference
Anonymous
If I've a vector : vector<int> v; and some elements are present in it
Anonymous
Then does writing v+1 gives the addresss of the 2nd element?
Pavel
i dont really understand r-value reference
Not many people do. Imagine calling a function with a value created like that: int smt = calcSmt(MyClass(arg)); This way compiler knows that MyClass is a temporary and you don't care what happens with it after the call. So it can call a move constructor with it instead of copy constructor. With std::move you can tell the compiler "I don't need this variable anymore, you can move it`, then the compiler will treat your variable as a temporary. The tricky part is what will happen to this variable after the call. - it can keep the same value as earlier (e.g. if you call move on an int, it will be replaced with copy assignment) - it can be cleared and ready to reuse (it's the case of STL containers) - it can be in some invalid state, working with which will send your program to UB The only thing that is guaranteed that this moved object can be correctly destructed
Anonymous
I want to make a recursive function such that each time i call it then I do fun(v+1) considers the 2nd element in the caller as the 1st element in the called function
Anonymous
To tackle that, do I need to pass the index?
Anonymous
doesn't v+1 work?
Anonymous
Hello!?
Dima
Welcome!
Anonymous
Thanks
Anonymous
How are you?
Niket
Thanku
Niket
Okay
Anonymous
v.begin() + 1
Basically I then want the called function to treat it like 0th index as in case of arrays
Artöm
You are free to use it as begin
Anonymous
ok so let me try it. thanx
Anonymous
/adminlist
Ms
How to gather two array
Ms
How to merge two array in third array
Badugar
Create an array with a size of the sum of both arrays and then move element by element from the old ones into the new one.
Ms
How to solve problem
Ms
Sorry but that program in java but i want to help about how to merge two array in third array?
Ms
Ok
Dr Giancarlo
How to merge two array in third array
Just a starter point: in your example exist only One Array, not Two or Three
Anonymous
How to solve problem
We don't use java here
Anonymous
And don't watch screen pictures
joel
How to solve problem
why are you asking a Java question in a cpp group
joel
How to solve problem
u never declare for loop variables outside the loop
MᏫᎻᎯᎷᎷᎬᎠ
.
Anonymous
There is a java group for java
Anonymous
As there is a C/C++ group for C and C++-related questions
Droid
we could do it but we dont knw whats the qtn
Gautam
Yes
joel
try this book you'll love it
Samuel
piracy?
joel
after every chapter there are programming challenges
joel
Yes
talking to u
joel
piracy?
whatever u call it