Beginners - June 2022 (Page 3)

Eliminating use of for loop with Eigen
 
I am trying to build a row vector and column vector using Eigen library to multiply them together to get a matrix without a use of for loop. Original code: ...
[1 reply] : See: https://eigen.tuxfamily.org/dox-devel/group__TutorialSTL.html (by JLBorges)
Extract rows/columns of matrices in C++ vs MATLAV
 
In MATLAB you can extract the first and last rows of a matrix by A(1,:); A(N,:); Is there a similar way in C++ where we can do this? For example, ...
[18 replies] Last: Thanks everyone for the incredible feedback/info! I am working with Ei... (by JamieAl)
iterator problem
 
I am copying an example from a book and it wont compile. I am trying to copy a vector<string> to a set<String> using transform, as it will make all the strings...
[4 replies] Last: Just been looking at it and I noticed the return type. Thanx for look... (by mickydint)
by sarvcr
Linked List with templates
 
Question Solved. Look at SeePlus comment if you have a problem like this. Hi! Long story short, I've been struggling way more than I'd like to admit to unde...
[9 replies] Last: It's working perfectly now. I really appreciate all the help you've gi... (by sarvcr)
char*/string function type
 
Hi folks! I'm trying to write DLL with a function that accepts a string, manipulates it and returns shorter version of it. Previously I was able to create si...
[4 replies] Last: @thmm Thank you, I used your code and it works now! You are awesome! ... (by Al Green)
What's the difference between overloading operator<(Class& a) and operator<(Class& a, Class& b)?
 
What is the difference between overloading operator<(Class& a) and operator<(Class& a, Class& b) ? Which needs to be defined for a user class for the std...
[8 replies] Last: How many calls are used when it's sorted Apparently still just 1. M... (by Peter87)
A calculator question
 
Hello I'm trying to implement a simple calculator supporting variables. And my question is the LValue can be int or var, and if it's unused the initial value s...
[10 replies] Last: istringstream gives a stream from a string. This can be used as a stre... (by seeplus)
Undefined reference?
 
Hi, i am new to C++ and while practicing i am getting an undefined reference error from the compiler and i dont know why... Can anyone see what the problem is b...
[4 replies] Last: Part of the problem is that you have global: const int NUMBER_OF_ROWS... (by keskiverto)
by Pen72
Graph problem
 
I'd like to know what condition have I not considered in the code, this should be a DAG problem right? My code appears to be wrong in the first sample test case...
[6 replies] Last: Hello, yes I think it should be m, must be typo mistake. Thank you for... (by Pen72)
Adding a blocker in a board to restrict cell access.
 
I have game of Abalone that I have created I am looking for ideas to insert a blocker on the board. This blocker should be randomly inserted on the space that ...
[5 replies] Last: Thank you, @jonnin, for the feedback on this and to @George P for the ... (by SITHESH)
by Pen72
Find words
 
I don't know where my code went wrong, I got two correct answers and 8 wrong answers, thanks in advance for any help. A word is defined as a string of w chara...
[4 replies] Last: #include <iostream> #include <string> #include <map> #include <set> ... (by seeplus)
by Pen72
inorder traversal
 
Hi I'm trying to implement inorder traversal in BST. The issue I got here is, if the data is already in BST, the operation must be ignored. I used a vector to ...
[3 replies] Last: Your question asks about Inorder traversal but your post alludes to tr... (by ElusiveTau)
map with iterator as key?
 
Hi I'd like to have a map where the key type is an iterator. This will not work out of the box because a map requires the availability of the less than operato...
[4 replies] Last: > Does anyone know a way of defining a less than operator to an iterat... (by JLBorges)
by Geckoo
Format integer as a string
 
Hello. Is there a way to format an integer according its memory size using to_string ? I explain my will by an example : std::string message = "my message"...
[7 replies] Last: Now the message is simply concatenated this way : snprintf(message, ... (by Geckoo)
No idea whats wrong
 
Hi, I have two weird questions, not sure if its something wrong with my code... 1) Why is my output 0 ? shouldnt it be 11 divided by 100 multipied by 50 = 5....
[7 replies] Last: However, for a computing system, if you divide an integer by an inte... (by Geckoo)
Failure of parameters transfer
 
Hello, I'm trying to build an ESP32-TMC2209 application. The setup of the TMC2209 includes invocation of a hardware serial port to send serial commands from th...
[6 replies] Last: Unfortunately it didn't help. (by yonagy82)
by Geckoo
Color spectrum
 
Hello everyone. I hope that all is fine for you. I am still playing with pixels. Now I am searching for a way to display a cool color spectrum using a simple lo...
[3 replies] Last: Done. Thank you ++ https://ibb.co/VDt23qs (by Geckoo)
by Ch1156
What is this code doing?
 
So i'm following this book called SFML Game Development By Example and I've run into some code I'm not too sure what its doing. This entire function I have s...
[1 reply] : Hello. This code is a good exercise to understand "complex" logical co... (by Geckoo)
decrement size_t in loop (1,2)
 
Hi everyone, I was recommended to turn on compiler warnings for debugging purposes. The compiler frequently complained that I was comparing signed and unsigned...
[25 replies] Last: > That approach works fine with VS release... >> Compile without it a... (by JLBorges)
Process exited with value 3221225477
 
Hello friends, I am currently working on a homework. But the code i wrote is not works as expected what i mean is that when i run the code sometimes i get the ...
[6 replies] Last: Thank you all. That helps a lot. (by hakanxdurak)
June 2022 Pages: 12345
  Archived months: [may2022] [jul2022]

This is an archived page. To post a new message, go to the current page.