
please wait
by CodeChaser
Smaller c++ questions (1,2)
|
I am going to be reviewing my C++ from scratch and will have smaller and sillier questions. Instead of making many posts, I will just put them in here as I revi... |
Jun 23, 2022 at 1:31pm
[39 replies] Last: [quote=protoseepp]I know that you told me that (begin, begin) & (end, ... (by Peter87)
|
by mickydint
return type amgiguity
|
I have just been learning about the algorithms in c++ and I am currently looking at 'mismatch' I read that the return type is a pair or iterators with three co... |
Jun 23, 2022 at 11:16am
[2 replies] Last: You are misreading the docs, sorry. https://en.cppreference.com/w/cpp... (by Duthomhas)
|
by klebermo
Integration between constructor and result of overloaded operator=
|
I have this class template<typename T, typename ... Args> class Function which needs to be declared and initialized this way: Function<int, int> f1('x... |
Jun 23, 2022 at 12:22am
[1 reply] : What is the purpose of the class template? In what context do you inte... (by mbozzi)
|
by keskiverto
issue to appoint two things
|
Wasn't the exact same question in: https://cplusplus.com/forum/beginner/283790/ |
Jun 22, 2022 at 7:02pm
[1 reply] : A couple of words were changed, making the post even less understandab... (by deleted account xyzzy)
|
alternate input issue |
Hello everyone, I am very new to coding and am making my through a C++ textbook. I am not a student, I am self-teaching to gain employment in the future. I a... |
Jun 22, 2022 at 2:38pm
[8 replies] Last: also very cool that if you multiply 1.0 to the result of two integers ... (by givingitago 88)
|
by klebermo
Get number of arguments passed to variadic function/method
|
If I have a class like this: template<class T> class Example { private: std::map<char,T> va; public: Example(char var...); } And I wanted al... |
Jun 22, 2022 at 7:29am
[11 replies] Last: @klebermo Your error message comes from this line: f1 = {p5, p6}; ... (by Peter87)
|
by ciullaantj
Review / Advice (1,2)
|
Hello everyone. Im a freshman in college taking my first programming class. It teaches c++. One of our final projects (I'm 5 weeks early to make sure I get it r... |
Jun 20, 2022 at 10:59pm
[26 replies] Last: One cool aspect of the {fmt} library, as well as C++20's <format>, is ... (by deleted account xyzzy)
|
Question about the move contructor |
Here is my code, I got instance a, and b created by Move constructor base on a. Class Move has one variable data. I think "move" make b "point to" a, so "a.... |
Jun 19, 2022 at 4:14pm
[1 reply] : The issue is in main(). &(a.data), &(b.data) is the address of the .da... (by seeplus)
|
by klebermo
class to aggregate and evaluate many functions in batch
|
I am trying implement a class which should be able to store several functions, like int p1(int x) { return ...; } or int p2(int x, int y) { return ...;} ... |
Jun 19, 2022 at 1:50pm
[7 replies] Last: I figured a working example might help. But you're right, it's essenti... (by mbozzi)
|
by mickydint
'include <cassert>
|
It the header file #include <cassert> still valid in modern c++? I know TDD users assert, but this is a different use. Has c++ moved on and if so what is th... |
Jun 18, 2022 at 10:55pm
[6 replies] Last: [quote=Peter87]I guess contracts would have been an alternative. We al... (by deleted account xyzzy)
|
by JamieAl
Eigen matrix vs for loop matrix give off results
|
Why is that if I print my matrix inside the for loop gives different results that when I print it outside? #include <cmath> #include<math.h> #include<stdio.h... |
Jun 18, 2022 at 6:45pm
[7 replies] Last: dv(j + (ny + 1)*i) oh yeah this is it, I have completely missed this... (by JamieAl)
|
by lilthanos
Need help :)
|
Hey guys good evening. So i've been stuck on this for a bit. The exercise asks me to get 2 answer from a void(). So I tried it doing it with void but I fo... |
Jun 18, 2022 at 5:46pm
[11 replies] Last: Code intent should always be clear. What intent can you derive from t... (by deleted account xyzzy)
|
by copypasta
Character Array & Pointer - Confused
|
int main() { char arr = {'F', 'C'}; std::cout << arr+0 << std::endl; // FC std::cout << arr << std::endl; // FC std::cout << &arr << std::... |
Jun 18, 2022 at 8:27am
[3 replies] Last: [quote=salem c]To see the pointer value, you have to cast it to some o... (by Peter87)
|
How can i change this [Try Catch] C++ code? |
Hello all im new to this forum and im a C++ beginner too so please forgive me if i did something wrong here.. This is what i want.... If i enter value... |
Jun 18, 2022 at 5:22am
[4 replies] Last: Yea that is exactly what i wanted...Thank you soo much sir i rly appre... (by TharinduCplusPlus)
|
by Rallonce
Optimizing finding the largest element in an array
|
I have written some code that executes fine, but I am looking to further optimize the code with any nuanced methods that I probably haven't learned yet in my cl... |
Jun 17, 2022 at 6:23pm
[6 replies] Last: well, you learned something in the class as well. The trick is getting... (by jonnin)
|
by Rendo
Difficulty understanding for loop iteration results (1,2)
|
Hi, I am extremely new to C++, I apologise in advance if my question is long winded or difficult to follow but here I go. I am reading through a book called C++... |
Jun 17, 2022 at 4:29pm
[25 replies] Last: I can't see myself using some sort of object for a local 2 element ar... (by seeplus)
|
by BuckedUp
Trying to print one digit at a time using a specific algorithm
|
Im trying to print on digit at a time for example, 123 would be 1 2 3 using an algorithim my proffessor is telling us to use but mines ends up printing 1... |
Jun 17, 2022 at 8:51am
[7 replies] Last: Here is the link for the algorithm OMG - what are they teaching the... (by seeplus)
|
by gabzz29
bug around while(!())
|
there is this bug around while(!()) where i have to re enter my year because it didnt register #include <iostream> using namespace std; int main ()... |
Jun 16, 2022 at 3:56pm
[9 replies] Last: Playing around: #include <iostream> #include <string> #include <typ... (by seeplus)
|
by ElusiveTau
No suitable constructor exists to convert from 'int' to 'Uint64' (user-defined type)
|
I can't compile parts of the SDL 1.2 (here ) with the Visual C++ compiler. In particular, this part (lines 3, 16): // Inside BinaryFile.cpp 1 Uint64 In... |
Jun 16, 2022 at 8:53am
[8 replies] Last: The error messages indeed suggest that Uint64 is being defined as a st... (by Peter87)
|
by Pen72
Minimal cycle size in graph
|
I got five passed cases and five wrong test cases with the code below, thanks for the help in advance. --------------------------------------------------------... |
Jun 16, 2022 at 3:59am
[6 replies] Last: Yes it works, thank you so much, and thanks for your explanation. (by Pen72)
|