General C++ Programming - August 2017 (Page 2)

regex - searching XML that doesnt contain a newline
 
Josuttis has given an example for a regex that searches XML (that doesnt contain a newline). The XM...
[3 replies] Last: However, the 2nd subpattern ([^<]*) (which searches for the value) lo... (by doug4)
Prima numbers
 
How can I write a c++ code based on this algorithm? **I'm new with C++. //Implements the sie...
[1 reply] : The general policy here is that we aren't going to just do your homewo... (by Ganado)
My c++ program i a lot of slower than my java counterpart
 
Good day. I have written a program in java and c++ which takes an int list as an input and returns a...
[7 replies] Last: you know how many you need, its a given computation... do a reserve on... (by jonnin)
by randym
How to get full path from relative path
 
Does anyone know any c++ function that I can use to retrieve a full file path from a relative file p...
[2 replies] Last: C++17 / Filesystem TS: std::filesystem::canonical() / std::experime... (by JLBorges)
by Li1
Overloaded oparators
 
Hi! I don't undstand overloaded operators...can you explane how it works...somebody.. Thanks
[3 replies] Last: In addition to max's excellent summary, the following lecture notes mi... (by gunnerfunner)
Why is SET slower than VECTOR in this case?
 
Hello. The code below runs faster with a Vector rather than with a Set vector<string>files{ "voc...
[5 replies] Last: Thank you everyone. Line 27 looks through the set, one item at a tim... (by gedamial)
Set MSB 0
 
I need to set the MSB of a decimal number to 0 which am taking as input. So i don't know how many b...
[15 replies] Last: #include <type_traits> #include <limits> #include <bitset> namespace... (by JLBorges)
DLL to be called with Unicode strings instead of ASCII (1,2)
 
Hi. I am using the following DLL in a program that uses the ASCII format for strings : #includ...
[28 replies] Last: Hi. Now the DLL works and provides the expected results. Thanks to a... (by richardv)
Program crashes at substr (positions are in range, using string)
 
Hi, could someone tell me why this program crashes every time when it goes to substr()? The crashin...
[5 replies] Last: A few problem areas. Mixing of formatted input cin >> with getline(... (by Chervil)
assignment of template descendant
 
hi everyone, i'd like to implement a "node tree": a node can have multiple children, but only 1 (or ...
[6 replies] Last: i solved it, i just removed the template T as base class and added a p... (by John87Connor)
picking index of unspecified array size
 
Hi all, my question is how do I pick a specific number from an array which has an unspecified size e...
[4 replies] Last: std::cout << "input a number for array size:"; std::cin >> size; ar... (by keskiverto)
by pivot
Reading C++ Source
 
Recently, a cloned Unreal Engine repo locally to my PC. There are tons of file in the repo, and high...
[9 replies] Last: try https://scitools.com/trial-download-3/ I can't test this, can't i... (by jonnin)
regex to find each 5-letter word in a sentence
 
I am using the following data string and regexes to find each 5-letter word in a sentence, but I get...
[4 replies] Last: gunner's solution works perfectly. \\b in a regex specifies a word bo... (by SSteven)
Finding 2 words in array
 
I have 1 dimensional two arrays each consisting of names of cities and number of items delivered to ...
[6 replies] Last: As already pointed out by Ganado if your strings have spaces you need ... (by jlb)
If else statement using single cout
 
Write a program to decide the class of family depending on its yearly income using if else with sing...
[10 replies] Last: There are 10 sorts of people: those who like PODs and those who like s... (by Enoizat)
"Delete" statement not working?
 
Hi there, Im recently writing a new code where a function returns a pointer, say *myp. Thing is insi...
[7 replies] Last: delete doesn't change the value of the pointer (which is an address)... (by zaratustra)
regex - Finding each vowel in a sentence
 
I am trying to write a program that uses the regex_search() function to find _each_ vowel in a sente...
[2 replies] Last: couple of additions that you may wish to consider: (a) std::regex_con... (by gunnerfunner)
regex_search() for digits not working
 
I have written a small program (based on an example in Josuttis' book) to search for an occurrence o...
[2 replies] Last: Another option is: regex("(\\d+)") data: Hello this is... (by Thomas1965)
by bcass
GPA Struct
 
So I can't get my program to run correctly: #include<iostream> #include<string> using names...
[4 replies] Last: OMG that worked thank you soo much !! (by bcass)
Function returning unexpected value
 
I have a function that should check at array of letters and return the number location of that lette...
[5 replies] Last: You could make your code work, but it’s prone to errors. For example... (by Enoizat)
August 2017 Pages: 1234... 9
  Archived months: [jul2017] [sep2017]

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