General C++ Programming - November 2019

Printing 5 Non-Duplicate Random Numbers
 
Hello everyone. I am trying to print out a set of unique random integers in an array (e.g. 1 4 2 3 0 ). An example of what would not work is 1 3 1 4 0 where ...
[6 replies] Last: If you choose 5 numbers from 5 with a reject-if-seen-before approach t... (by lastchance)
by MISSP
If - Else statement skipping the if block
 
Hi, I am working on booking system and have added an if - else statement in my setRating function to compare user input to make sure invalid input is not ente...
[1 reply] : I don't see anything obviously wrong with the code. Post an example wh... (by helios)
AVL double rotation without doing two single rotations
 
I am writing a program that inserts nodes in to a tree and then attempts to balance whatever subtree has a depth more than 1 larger than the subtree next to it....
[6 replies] Last: Thanks for the help. (by vaderboi)
How to use shared_from_this without having a pointer?
 
I am implementing my own version of Dancing Links, a 2D linked list. Dancing Links is based on Nodes that refers to their four neighbours. To do this, I need to...
[2 replies] Last: But the problem with this is that I have discovered that shared_from_... (by malibor)
instruct compiler to determine the overloaded function the coder like
 
How to instruct compiler to determine the overloaded function the coder wants among other OFs when error: call of overloaded ‘a_function’ is ambiguous l...
[5 replies] Last: > How to instruct compiler to determine the overloaded function the co... (by JLBorges)
XML Parsing using xerces
 
Hi All, Xerces version : 3.1.1 I am getting bad pointer when trying to get the node value. Sample XML as bellow: <code> <A aa="xxx"> <tag1>number1...
[1 reply] : Where do you set node ? (by lastchance)
AVL double rotation without doing two single rotations
 
I am writing a program that inserts nodes in to a tree and then attempts to balance whatever subtree has a depth more than 1 larger than the subtree next to it....
[1 reply] : Duplicate of http://www.cplusplus.com/forum/general/265792/ (by MikeyBoy)
by volang
How does find() work internally?
 
Functions such as find(), how do they work internally. Do they compare exactly every character in a str/char array until they have the right sequence? (brute...
[7 replies] Last: The standard library makes it easy to use the Boyer–Moore and the ... (by Peter87)
Ill formatted array
 
#include <array> const int MAP_X = 3; const int MAP_Y = 4; template<typename T> class Tile { public: Tile( T t ) : mTile(t) {}; T & opera...
[2 replies] Last: Thank you! (by nuderobmonkey)
CRTP and Israel Joining the C++ ISO
 
Rob and Jason are joined by Inbal Levi. They first discuss some news including a new C++20 unit testing framework and Microsoft bringing ASAN to Visual Studio. ...
[5 replies] Last: I'm not the one that reported, because it doesn't do shit, but it woul... (by Ganado)
for loop printing number and spaces
 
i am trying to print numbers like this 54321 5432 543 54 5 but its not printing the way i want #include<iostream> using namespace std; ...
[5 replies] Last: #include <iostream> #include <string> using namespace std; int main()... (by lastchance)
by volang
POST request missing values. Handle with C++
 
Im trying to set up a web server that receives and handles a couple of http requests. Unfortunately, I'm stuck on "POST multipart" requests. I use a html fo...
[1 reply] : See this: Accept-Encoding: gzip, deflate, br It looks like the cont... (by coder777)
Compile c++ library using node 12+
 
Hi Everyone, I am not a conversant c++ user, however, I have used this library before (https://github.com/nukedzn/node-tcl) using node 8 and currently its mai...
[7 replies] Last: Dear jonnin, Did you get a chance to help me out with compiling the l... (by rihabesx)
rand into variable
 
Hi, I'm new here and just started learning C++. I'm trying to recreate "Hang Man" game using only #include <iostream> (and apparently #include <ctime> and #i...
[2 replies] Last: char b1='_'; char b2='_'; char b3='_'; char b4='_'; char b5='_'; char... (by dhayden)
FAST protocol with FIX 4.4
 
I am newbie to C++ FIX engines Development and I would like to know if is possible use C++ FAST protocol with FIX 4.4 protocol in my broker.
[4 replies] Last: Ok, never heard of FAST previously, but apparently, FAST is streamed c... (by kbw)
How to print a 2D visual of a BST from root to leaves?
 
I am having a hard time knowing how to print a 2D visual of a binary search tree from root to leaves because I don't how to accomplish this and have the tree pr...
[7 replies] Last: Slightly more reliable version. #include <iostream> #include <algori... (by lastchance)
by Dee5
CHALLENGE..have fun
 
Your flash disk with important school files was infected by an LHS virus. You have successfully scanned and removed the virus from all folders in the flash disk...
[3 replies] Last: Use the command line for this kind of work: find flash-disk -name "*.... (by mbozzi)
Problem with connecting 2 computers on LAN in C++
 
Hello fellow programmers! I am writing a program in C++ that is supposed to allow for real time data transfer between 2 computers over LAN using windows sockets...
[4 replies] Last: However, this is part of an assignment I got, where I am told to not ... (by helios)
Debug by breakpoint setting on "std::logic_error"
 
How to debug by breakpoint set the 'std::logic_error what(): basic_string::_M_construct null not valid' how to apply assert() on such ?
[3 replies] Last: It's not good practice to mix asserts and exceptions. Disagree. The... (by mbozzi)
by Dee5
How to browse through folders
 
Hello, sorry but I need help on how to browse through folders and subfolders in c++ searching for certain file. Thanks in advance
[4 replies] Last: Thanks (by Dee5)
November 2019 Pages: 123... 8
  Archived months: [oct2019] [dec2019]

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