Anmol
Hmm. Yep, i don't want to use it after the for loop
Anmol
What, what reference? The auto&& edge one?
Anmol
Hmm. So it will automatically deduce it as a rvalue reference?
Anmol
Yeah, though so lol.
𝐀𝐡𝐦𝐞𝐝 𝐄𝐡𝐚𝐛
𝐀𝐡𝐦𝐞𝐝 𝐄𝐡𝐚𝐛
I need this book
Dima
buy it
Dima
no piracy here
𝐀𝐡𝐦𝐞𝐝 𝐄𝐡𝐚𝐛
𝐀𝐡𝐦𝐞𝐝 𝐄𝐡𝐚𝐛
Anonymous
this reminds me
https://github.com/chandradeepdey/C-_Primer_5th/blob/master/15/15.42/Query_parser/Query_parser.cpp 1) is the std::move() on return in line 114 ok? 2) can the whole query parsing thing be done more efficiently somehow? relevant classes a Query object can take a string or the AND/OR/NOT of other Query objects. TextQuery takes a file and uses getline() to produce a vector of strings which is kept in a std::shared_ptr, and it keeps a map that maps each word in the file to a std::shared_ptr to a set of line numbers in which the word appears. Query::eval(TextQuery tq); produces a QueryResult object. QueryResult objects hold a shared_ptr to a set of line numbers from before, a shared_ptr to the getline() vector from before, and the queried string. it may be printed directly through operator<<
Anmol
Idk, I'm no expert. I just stated what I saw on the cppcon 2019 move semantics vid lol
Anonymous
Item 41:Consider pass by value for copyable parameters that are cheap to move and always copied Item 42:Consider emplacement instead of insertion. these don't seem to be relevant
Anonymous
Idk, I'm no expert. I just stated what I saw on the cppcon 2019 move semantics vid lol
yes i searched around on google. everyone mentions RVO and NRVO, but i'm not moving an entire object. if you look at it, i'm doing std::move(stack.top());
Anonymous
okay
Anonymous
but why, the Query class guarantees that calling the destructor is fine after a move operation
Anmol
why ;-;
Because that's how std::move works
MᏫᎻᎯᎷᎷᎬᎠ
why ;-;
top() returns a reference to the top object Pop decrease the the index without returning a thing
Anonymous
i googled what MVCE is. but the thing is i don't actually have a problem, i'm asking
Anonymous
ye this, and whether the parser can be made better
Anonymous
top() returns a reference to the top object Pop decrease the the index without returning a thing
i turn the reference into a rvalue reference, move it out. this causes a call to the move constructor/move assignment operator which handles the members of Query to make sure that running the destructor on it is fine even after the move. it doesn't become "invalid" after the move
Anonymous
okay
Anonymous
ye reading the points you mentioned
Anmol
Iso cpp guidelines suggest using non-const reference for in/out parameters while google's suggest using pointers. Which do you think is better and why?🤔
kaka
Bro I have to make a responsive website for my project
kaka
So tell me from where I can get the source code I have not much time left
M.Ridvan
You are in the wrong place. But you can go to w3schools website and learn how you can make it!
Marco
Marco
Someone know why?
Anmol
Also, the code would not run past the while loop because the table size is 0
Marco
So how can I store a text like this: CREATE TABLE Students ( ID INT NOT NULL, NAME TEXT NOT NULL, ); ?
Wisenky
fread function claims characters from FILE* dosya and put them into buffer fread(buffer, 128, 1, dosya); printf("%s", buffer); do this
Anonymous
Anonymous
Sorry, what are apis?
functions and structures and stuff made in the language you are programming in to directly access the database
Anonymous
https://www.postgresql.org/docs/current/libpq.html for postgres
Emir
I want to change txt file changeDir(“hi”, "11111111111"); i did it that function, but it doesn’t work healty it does overwrite another string, what is the solution of this problem?
Oleg
/start@MissRose_bot
Albert
/start@MissRose_bot
Iroh
https://paste.ubuntu.com/p/zH3mbcmfN8/ Hi. For avoid duplicate code, i want to build this generic structure. I want the numbers24 vector inside the scaledown24 struct to be different from the numbers32 vector inside the scaledown32 struct. So when I make a change, they won't be able to influence each other. But when I run the program, the printAdress function shows that the address of the two vectors is the same. How can i fix this. Thanks.
Anonymous
hellooooow
Anonymous
Jelou :v
Anonymous
Hello xd
JCV
please i need help i have a sshcon.h with this function definition int connectHost(char *hostname, char *username, char *password); then i include sshcon.h on another header sshrem.h when i call that function on sshrem.cpp in this way if (connectHost((char *)ui.ipAddress->text().toUtf8().data(), (char *)ui.userName->text().toUtf8().data(), (char *)ui.userPassword->text().toUtf8().data()) == 0) { } i get the error Symbol(s) not found for architecture x86_64
JCV
what's wrong here?
Anonymous
sorry i do not speak inglish
Dima
You’ve got a header but you also need to let a linker know
Anonymous
Pass these as compiler arguments
Dima
@Neko_cpp can u look at that question pls?
Do you want to rename a file?
Dima
That was a question
Dima
Emir
Do you want to rename a file?
No no i want to search my file in X string and i want to change to Y string, i did it but if X string 5 characters and Y string is 10 characters, it doesn’t work that what i expected
Emir
I can delete X string and i can overwrite Y string to locate of X stirng, but next to X string is gone
Emir
Etc: dima bla bla bla changeDir(“dima”, “!!!!!!!!!”); !!!!!!!!!!bla
JCV
anyway i have the same issue and this "connectHost(char*, char*, char*)", referenced from: QtSSHRemote::connectClicked() in qtsshremote.o on compile output
Emir
English pls
..
Hii
Sasuke
Hi
Sasuke
I am struggling with understanding things from docs of libraries. Whenever I want to use a library I got to docs section But it's just a huge mess of hyperlinks of different functions
Sasuke
How do I know what functions do I need in what order
Sasuke
Someone please tell me a effective way to read docs
Haseeb
Hi, how many ways you can set values for an one dimensional and two dimensional integer array and for string?
Haseeb
Can anyone answer this? I have searched a lot in google but not getting any exact answer
Alpha
anyone here good at algorithms and data structure message me, u will b paid
Dima
/warn bitly link
Sinan
Guys what is the easiest way to get words occurrences in a file in c Just like //test.txt sun shine sun sun sun shine output must be sorted sun - 4 shine - 2 thanks in advance
noop
Guys what is the easiest way to get words occurrences in a file in c Just like //test.txt sun shine sun sun sun shine output must be sorted sun - 4 shine - 2 thanks in advance
This might work: you can read the file line by line, and for each line, use "strtok_r" with space as delimiter. The detected words should be compared to the previously detected list of words by "strcmp". If not detected before, you should add it to the list. A simple 1D int-array can be used to keep the histogtram updated.
Anmol
@admin please ban this guy🤦‍♂️🤦‍♂️