Search:
Type: Posts; User: 2kaud
Search:
Search took 0.05 seconds; generated 11 minute(s) ago.
-
June 14th, 2022, 03:30 AM
The best on-line free resource to learn C++ is https://www.learncpp.com/
For a book, IMO the best to learn from is Ivor Horton's Beginning C++: From Novice To Professional...
-
June 13th, 2022, 03:22 AM
Sorry my bad - I blame not enough coffee! When I was going through the original code I misread one line and used 8 instead of v.size() - 1.
I've also changed in main re detecting no move possible...
-
June 12th, 2022, 12:03 PM
As an example of using std::unordered_set consider:
#include <iostream>
#include <unordered_set>
struct Pos {
int i {};
int j {};
-
June 12th, 2022, 11:43 AM
You need to maintain a container of already visited locations. I'd suggest a std::unordered_set
https://cplusplus.com/reference/unordered_set/unordered_set/
insert only works if the value to be...
-
June 12th, 2022, 10:52 AM
Then you need to use the debugger to trace through the code to see where is the issue.
When I ran the code, I was getting -ve values for moved to in disp().
Moved to (11,1)
Total moves :...
-
June 12th, 2022, 04:10 AM
There are various issues with variables being defined at global or function level and then at local scope level.
As a start, this revised c++ code compiles cleanly. If it now doesn't work as...
-
June 11th, 2022, 04:31 AM
The original question was
When signed/unsigned operations are mixed, the signed will always be 'promoted' to unsigned. Then the operation is performed. This automatic promotion is often...
-
June 10th, 2022, 10:18 AM
[also asked here https://cplusplus.com/forum/windows/283922/ ]
-
Just trying to help... Some aspects of C++ can be confusing/bewildering (add your own adjective!).
-
... but that would require the OP to actually do some work as opposed to being spoon-fed!
-
Several of the std::algorithm functions work in the same way. eg sort()
-
It depends upon how the program has been coded. If it is coded as a multi-threaded program, then the number of threads used is dependent upon how the program uses threads. It might be coded to just...
-
Whatever the default constructor does - if the class has no member variables then nothing.
std::max (along with most other algorithms) is template based. See...
-
It could be by someone who knows both C++ and Java. However I doubt that anyone looking at this thread with the requisite skills will actually do this 'ex gratia'. This forum isn't for getting work...
-
Yes. It's a class name. What happens 'under the hood' is that the supplied class is instantiated using the default constructor and then from that object the operator() function is called with the...
-
-
That is a ComplexComparer constructor that takes 2 args. If ComplexComparer had such a constructor it would be called first with the given constructor args, Then the operator() would be called with...
-
Through the operator() which takes 2 args.
-
std::max calls operator() [the same as other functions that call functors]. The passed args to operator() are a and b from std::max()
-
Have you tried installing the Intellisense Extender as an extension? It provides additional info re potential code issues.
-
Well either it's a really boring party or this thread isn't meeting it's objectives........
-
#include <iostream>
#include <iomanip>
bool checkPalindrome(unsigned original) {
unsigned reverseNum {};
for (auto tempOriginal {original}; tempOriginal > 0; tempOriginal /= 10)...
-
We've all made stupid mistakes at least once, twice...
-
Do you mean file permissions or file attributes? These are quite different.
-
April 28th, 2022, 03:15 AM
See https://docs.microsoft.com/en-us/visualstudio/releases/2022/release-notes-preview
|
Click Here to Expand Forum to Full Width
|