General C++ Programming - June 2018 (Page 7)

Efficiency for Style?
 
Generally, I like to break down my if statements into predicate functions for clarity and neatness. A typical function I might write looks like this: void Ne...
[7 replies] Last: I guess readability is subjective, but to me That's good feedback th... (by Aaron Vienneau)
by Lahs
Competitive programming
 
Sheokand loves strings. Chef has N strings S1,S2,…,SN which he wants to give to Sheokand; however, he doesn't want to give them away for free, so Sheokand mus...
[1 reply] : Please note that this is not a homework site. We won't do your homewor... (by keskiverto)
by d3vcho
How to lowercase string with special chars?
 
Hello! I need to lowercase a string that may contain special chars like, for example, "Á". I saw that the tolower() function does not lowercase this type of c...
[2 replies] Last: Hello Thomas, thanks for the fast answer. Excuse me but I'm kinda new ... (by d3vcho)
by Dani90
find all possible permutation for n integer
 
Hello.. how to find all possible permutation for n integer using backtracking algorithm
[3 replies] Last: Then say something in that post instead of TOTALLY IGNORING PEOPLE WHO... (by tpb)
logic bug
 
i guys am using qt to make a simple x and o gui, whenever I click on button number 9,it will seem to end the game can anyone spot why? I've scanned throu...
[2 replies] Last: thanks Jonnin very true,I actually do go out of bounds in my bool ar... (by adam2016)
by Heymid
De-allocation problems when stacking container onto container
 
#include <iostream> using namespace std; template <class T> class Container { private: T* myList; size_t length; public: Container() ...
[4 replies] Last: I had to implement the copy assignment operator to make the functional... (by Heymid)
SFINAE
 
Hi guys, I am following along with this tutorial from a blog post https://jguegant.github.io/blogs/tech/sfinae-introduction.html // reallyHas<std::stri...
[11 replies] Last: int (*p)(void*,void*); , so p is a pointer. int *q; , so q is a poin... (by helios)
by Heymid
Invalid argument type to unary expression
 
class Formula { public: virtual bool isTrue() const = 0; }; class VariableFormula : Formula { protected: bool value; public: VariableFormula(bool...
[4 replies] Last: UPDATE: Actually, I take it back, the solution I thought I had is not ... (by Heymid)
help with my median function
 
Write your question here. my professor gave us function prtotypes to work with and we have to use those and I don't get any errors with my code but it keeps on...
[4 replies] Last: In other words, why are you doing this? *makeArray(num_student); Yo... (by Ganado)
dev c++ undefined reference linker error
 
I have a problem to compile this code: http://gfx.cs.princeton.edu/gfx/proj/sugcon/software/rtsc-1.6.zip I used Dev c++ in windows and solve some errors,and...
[no replies]
Help with EIGEN library
 
Hi all, I am in a bit of trouble trying to make things work, and hopefully you can help me here. I have to submit an important project tomorrow, and I hav...
[4 replies] Last: Thanks for the replies guys, it has been solved already. It seems like... (by zaratustra)
Background c# and PicturBox
 
Having problem while i make to form a background and put photo to a picturebox i found that backcolor apear if my picture like circle i don't can you help me t...
[3 replies] Last: thank you very much it works (by hazemds)
ARRAYSIZE error
 
Hi everyone! When I use ARRAYSIZE() function in this solution, i take error (no instance of function template "RtlpNumberOf" matches the argument list) can anyo...
[no replies]
runs on Mac but not Windows
 
Hello, I was learning c++ on Mac all the time, now have a teacher who requires code to compile on windows Visual Studio. While my code is fine on VS 2017 Mac ...
[7 replies] Last: [quote=asder]Are you running on C++11 or newer? Visual Studio 2017 us... (by closed account E0p9LyTq)
textSearch c++
 
how can i make a text search for example when i write character on the text it Give me all the possibilities that begin with the same character from database a...
[9 replies] Last: Why don't you tell us about the GUI framework you use? In WPF you coul... (by Thomas1965)
save/load file with vector of object using rapidjson c++
 
I am trying to make a simple "person" vector of objects which can be saved and then loaded from real file to vector of objects. I made a function found in some ...
[no replies]
by riju23
Code to take input csv/txt, sort, output csv/txt
 
The data file provided consists of trajectories of vehicles for 10 min (600s) with various fields such as Time (s), Vehicle number, Longitudinal position (m), L...
[1 reply] : captain obvious wonders why data that is already readable by a spreads... (by jonnin)
by zire
array with do while loop
 
guys can someone please help in the while(ans=='y) even it is not equal to y it goes on the loop please help thanks in advance #include <iostream> #include <c...
[1 reply] : You're asking the user if they want to play again inside a for loo... (by Repeater)
by asder
Finding Cycle in directed graph misbehavior
 
I am making a directed Graph class. I want find if there is any Euler Cycle and update a vector with it's path accordingly. My Function some times work but othe...
[4 replies] Last: I if remove push_back on the else if it skips some edges (by asder)
Having problems with this code...
 
Fill even/odd vectors anmd transfer to a 2-D Array Purpose: Input numbers and segregate them by placing their values into even or odd vectors based upon their ...
[1 reply] : Format your code with the <> button when you edit your post, and rep... (by poteto)
June 2018 Pages: 1... 56789
  Archived months: [may2018] [jul2018]

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