Anonymous
how can i use any coding tool to unlick my phone UI
Anonymous
someone help me please
Nameful
how can i use any coding tool to unlick my phone UI
Once you licked it you cannot unlick it
Anonymous
but i was only asking to get help
Nameful
meant unlock
What do you want to unlock?
Anonymous
but i was only asking to get help
It's not the chat for unlocking your phone
Anonymous
People, stop discussing offtop
Anonymous
Go to the OT chat
Anonymous
Any idea how to solve issue of open and close new terminal before completion of program while using gnome-terminal for multiple file?
Anonymous
I want to execute multiple c program simultaneously by opening multiple terminal via gnome-terminal. Terminals are getting open but getting close without executing complete program
Anonymous
@gnome-terminal -e "./3gpp_rel9 @gnome-terminal -e "./mac_rel9
Anonymous
@gnome-terminal -e "./3gpp_rel9 @gnome-terminal -e "./mac_rel9
Terminals are getting open but simultaneously getting close without executing whole program
Anonymous
can you suggest me a program to rest sockets ? i wrote a socket server and i want to test it
Anonymous
/ban @apaansihm pming
V01D
This is not a chat to discuss terminal problems
That is on topic, his C/C++ code wasn't fully executing.
Manish
Hi, I have class A(FooPtr&& x); I have on method inside that I have to initialise class A in fooMethod like that static void fooMethod(FooPtr&& y) { new A(y); } I am getting error like "error: cannot bind rvalue reference of type 'FooPtr&&' to lvalue of type 'FooPtr'" . Help appreciated.
Tom
new A(std::move(y))
Tom
u are welcome
MᏫᎻᎯᎷᎷᎬᎠ
What happens under the surface when casting a lvalue reference to a rvalue reference?
MᏫᎻᎯᎷᎷᎬᎠ
nothing. you can just pass this var as rvalue now
So it's just the compiler way to mark a value/variable must be passed to a certain function overload?
MᏫᎻᎯᎷᎷᎬᎠ
Because std::move uses static_cast from lvalue to rvalue reference
MᏫᎻᎯᎷᎷᎬᎠ
Which directs the compiler to pass the variable to this function
MᏫᎻᎯᎷᎷᎬᎠ
Not sure tho
Alex
So it's just the compiler way to mark a value/variable must be passed to a certain function overload?
I think yes. even in this case void func(type &&val) { type val2 = val; //val is lvalue, you should cast to rvalue again }
MᏫᎻᎯᎷᎷᎬᎠ
Why It's explicitly declared lvalue It's not even a T&&
Alex
Why It's explicitly declared lvalue It's not even a T&&
for flexibility. you can use type val2= val as lvalue, and later in this func as rvalue
MᏫᎻᎯᎷᎷᎬᎠ
for flexibility. you can use type val2= val as lvalue, and later in this func as rvalue
Ohh Because we normally call functions with lvalue params, so we don't have to cast it lvalue everytime in that function block which declared rvalue
Alex
Ohh Because we normally call functions with lvalue params, so we don't have to cast it lvalue everytime in that function block which declared rvalue
you don`t need cast to rvalue calling func for temporary val like func(type()). also lots of guys suggest to use void func(type val) instead of void func(type &&val)
Tom
the variable y is binded to a r-value, but itself is a l-value.
Alex
Why they suggest that? func(rvalue) doesn't make a copy, right?
right. 1. you can use the same void func(type) for rvalue and lvalue(make a copy) 2. type val; func(std::move(val)) you don`t know it was actually moved or not
MᏫᎻᎯᎷᎷᎬᎠ
MᏫᎻᎯᎷᎷᎬᎠ
Unless it's a const The compiler then make some workaround
Tom
static void fooMethod(FooPtr&& y)
Alex
I think it's moved there
consider void func(type &&val) { if (rand() % 2 == 0) type val3 = std::move(val) }
Anonymous
Hi come someone help me with something
Anonymous
l forC++
Anonymous
best tutorial for c++
Anonymous
??
Dima
best tutorial for c++
/warn read the rules
Anonymous
😊
Anonymous
hi
Gabriel
/get ide
Nils
#include <stdio.h> #include <stdlib.h> #include <stddef.h> #include <string.h> static char const *test[] = {"Hello World!", "Blah", "This is a string array!", NULL}; void walk(int a, int b, int *counter) { (*counter)++; if (test[a][b] == 0x00) { if (test[++a] != NULL) { walk(a, 0, counter); } return; } putc(test[a][b], stdout); b++; walk(a, b, counter); } int main() { int *counter = malloc(sizeof(int)); *counter = 0; walk(0, 0, counter); printf("\nCounter: %i\n", *counter); free(counter); } Is this good code to teach recursivity?
Andrew
are you a teacher?
Anonymous
Hello
Anonymous
😊
olli
No. factorial calculation is much better.
I would not teach an algorithm that is O(2^n)
Anonymous
I would not teach an algorithm that is O(2^n)
Wow....you are a software engineer....
Rahul_
Anybody has attended the meditab company xam recently?
Anonymous
Why always coundition is true when in the loop zero come ?
klimi
What? O.o
Anonymous
Can you give us an example?
for i=10,i,i-- ..... /My Syntex can be wrong but my feelings you can understand I am learning c few hours so no question about syntex
Pavel
for i=10,i,i-- ..... /My Syntex can be wrong but my feelings you can understand I am learning c few hours so no question about syntex
It's a loop that start from i=10, then after the each step it does decrement operator (i--) that reduce i by one and check whether i converted to bool is true (basically whether i is not zero) I would say that the loop condition is lazily written and it should be i != 0 or i > 0 instead to make the logic more explicit to the programmer who will read the code. Like this for (int i = 10; i > 0; i--)
Tobias🐾🚲
su
Absolutely not, as recursion precisely should avoid a counter in initial examples and you go down until there are no more elements, then return upwards.
also, recursion on each char is bad, due there will be limitation to 2000 char strings or less (at least extremely stupid)
Anonymous
Please help
వ్లాదమిర్ పుతిన్
Please help
homework again?
వ్లాదమిర్ పుతిన్
what have you tried?