
please wait
Prima numbers |
How can I write a c++ code based on this algorithm? **I'm new with C++. //Implements the sieve of Eratosthenes //Input: A positive integer n > 1 //Ou... |
Aug 28, 2017 at 9:01pm
[1 reply] : The general policy here is that we aren't going to just do your homewo... (by Ganado)
|
by bstefan96
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 list of all possible permutations. I used the exact same lo... |
Aug 28, 2017 at 2:07pm
[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 path. |
Aug 28, 2017 at 4:00am
[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 |
Aug 28, 2017 at 1:29am
[3 replies] Last: In addition to max's excellent summary, the following lecture notes mi... (by gunnerfunner)
|
by gedamial
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{ "vocabolario1.txt", "vocabolario2.txt", "vocabolario3.txt" }; /... |
Aug 27, 2017 at 10:06am
[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 bits are there in the binary representation of the number. Ho... |
Aug 27, 2017 at 4:21am
[15 replies] Last: #include <type_traits> #include <limits> #include <bitset> namespace... (by JLBorges)
|
by richardv
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 : #include <windows.h> #include <string> using namespace std; ... |
Aug 27, 2017 at 3:06am
[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 crashing part is at line 70, it is really pissing me off. I've prin... |
Aug 26, 2017 at 1:04pm
[5 replies] Last: A few problem areas. Mixing of formatted input cin >> with getline(... (by Chervil)
|
by John87Connor
assignment of template descendant
|
hi everyone, i'd like to implement a "node tree": a node can have multiple children, but only 1 (or no) parent. besides the node hierarchy, each node has additi... |
Aug 26, 2017 at 12:26am
[6 replies] Last: i solved it, i just removed the template T as base class and added a p... (by John87Connor)
|
by PopRockCandy
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 efficiently? I'm sure I could traverse the array from the beg... |
Aug 25, 2017 at 8:29pm
[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 quality codes. It's a great pleasure to read professionally... |
Aug 25, 2017 at 3:26pm
[9 replies] Last: try https://scitools.com/trial-download-3/ I can't test this, can't i... (by jonnin)
|
by SSteven
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 incorrect results as indicated: string sentence =... |
Aug 25, 2017 at 2:51pm
[4 replies] Last: gunner's solution works perfectly. \\b in a regex specifies a word bo... (by SSteven)
|
by Elia Ashraf
Finding 2 words in array
|
I have 1 dimensional two arrays each consisting of names of cities and number of items delivered to that particular city. Now I need to find a two letter word ... |
Aug 25, 2017 at 2:50pm
[6 replies] Last: As already pointed out by Ganado if your strings have spaces you need ... (by jlb)
|
by shivamjain1
If else statement using single cout
|
Write a program to decide the class of family depending on its yearly income using if else with single cout The various classes are : < Rs 50000 very poor 50K... |
Aug 25, 2017 at 2:13pm
[10 replies] Last: There are 10 sorts of people: those who like PODs and those who like s... (by Enoizat)
|
by zaratustra
"Delete" statement not working?
|
Hi there, Im recently writing a new code where a function returns a pointer, say *myp. Thing is inside this function, the pointer myp points towards an array of... |
Aug 25, 2017 at 2:05pm
[7 replies] Last: delete doesn't change the value of the pointer (which is an address)... (by zaratustra)
|
by SSteven
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 sentence. The regex_search() function call is as follows: ... |
Aug 25, 2017 at 10:47am
[2 replies] Last: couple of additions that you may wish to consider: (a) std::regex_con... (by gunnerfunner)
|
by SSteven
regex_search() for digits not working
|
I have written a small program (based on an example in Josuttis' book) to search for an occurrence of digits in a string: /* The following code example is... |
Aug 25, 2017 at 7:19am
[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 namespace std; struct student { int credit ; char grade ... |
Aug 25, 2017 at 12:10am
[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 letter in the array. char CHARSET = { 'A', 'B', 'C', 'D', 'E'... |
Aug 24, 2017 at 9:49am
[5 replies] Last: You could make your code work, but it’s prone to errors. For example... (by Enoizat)
|
by tario
error: invalid use of non-static member function
|
I keep getting the compile error: vclPCG.C: In member function ‘virtual Foam::solverPerformance Foam::vclPCG::solve(Foam::scalarField&, const scalarField&,... |
Aug 24, 2017 at 3:10am
[1 reply] : ¿is that openFoam? ¿what part is your code? I need to see more cont... (by ne555)
|