General C++ Programming - January 2020

Why does cin get skipped?
 
I have this short snippet: int main() { cout << "User Input... "; int userChoice = ...
[13 replies] Last: Cool, thanks! (by DynamicSquid)
Graphics Menu in C++
 
I am working on a project and I want to make a Graphics Menu. Issue which I am facing is that afte...
[1 reply] : Could you provide a minimal reproducible example? (by DynamicSquid)
Learn how to use vectors
 
Hi! I was searching a nice tutorial to learn all about vectors. Does someone recommend a specific s...
[9 replies] Last: Tada ... (by againtry)
Why does an integer prompt accept strings?
 
I have this code... int userChoice; cin >> userChoice; if (userChoice == 0) cout << 0; if...
[5 replies] Last: Whitespace doesn't matter. if (a) part_of_if_statement(); ... (by Ganado)
by GisiNA
How to see the content of a specific memory having only the address
 
Hello all! First of all... Sorry for my English. :-) Now to my problem. I am trying to see if it ...
[6 replies] Last: It requires asking your operating system to let you read the memory of... (by Repeater)
Get the last digit of a number
 
How can I get the last digit of an int?
[14 replies] Last: Sigh. Sorry about that … I hate when I do that (by jonnin)
WoW, I didn't know what emplace(_back) function is faster than push(_back)..
 
I was just testing emplace_back or push_back(vector) or emplace or push (stack) and I got new info(j...
[6 replies] Last: I was just testing emplace_back or push_back(vector) or emplace or pu... (by mbozzi)
Breadth-first traversal for top down tree
 
template<class BaseData> inline void TDTree<BaseData>::breadthFirstTraversal(void(*processnode)(Bas...
[3 replies] Last: > 't' has a first child 'h' and its siblings 'r' and 'e'. ¿how do you... (by ne555)
A shopping bill
 
I have a school project to make, I've been asigned with 2 other people who has no idea what programm...
[6 replies] Last: #include<stdio.h> #include<string> #define max 50 int main() { int l... (by codyy)
Extraction of data from .txt file
 
Hi Guys i have a file name ABC.txt and it includes the following data: login as: rokob Using ...
[7 replies] Last: You're looking at use of #include <iomanip>, setw, right, left etc Us... (by againtry)
0's of a factorial
 
I want to make a program which takes a number n and then outputs how many 0's the factorial has on t...
[9 replies] Last: Oh ok. Haven't seen dutch's comment (by yabi2943993)
by Odglog
Per Object Function
 
Hello! This is a quick one, is there any way to make a class with a member function that gets define...
[13 replies] Last: Thanks everyone for the help! I think I will go with @mbozzi approach.... (by Odglog)
Drawing a chess table
 
Hi. I want to make a program which draws a chess table. This table should not contain white and blac...
[7 replies] Last: Thanks to all for your help! (by yabi2943993)
Can there be more than one n0 of a function in Asymptotic Notations?
 
Considering the case of Big-O here (as an example), you would know that, f(n) is O(g(n)), if fo...
[3 replies] Last: Once you identify a value n0 for which f(n) <= c g(n), EVERY INPUT SIZ... (by doug4)
array type to Array class type
 
How could we convert a primitive array type to Array class type as in Array lib. so it's size can be...
[3 replies] Last: what problem are you trying to solve? New/delete calls done foolishl... (by jonnin)
binary calculator using vectorbool in c++
 
I´m trying to write a program in C++ in which I could std::cin a binary number of the type std::vec...
[1 reply] : we can't fix it without seeing it... post your code (in tags, the <> t... (by jonnin)
How do I find 10 most popular names from HUGE string array, it has like 850 names???this is a school project
 
void insertInMap(map<string, int>& m, string s){ if(m.find(s) == m.end()){ m = 1; ...
[11 replies] Last: Here's what I meant. #include <iostream> #include <map> #include <str... (by dhayden)
What is this way that something weird return?
 
I was solving Leetcode, and I saw someone's code. and I saw an interesting code that when a function...
[4 replies] Last: Thank you, guys!! (by woohyeon)
Working with debug and optimized builds in one project
 
I've gotten my project to a point where it segfaults, so I'd like to use the debugger to find out ho...
[1 reply] : I haven't used CodeLite before, but just as a cursory glance, it appea... (by Ganado)
How do I turn word into a list of letters
 
If I am given a string say "helloworld" , how do I convert it into a list say l which is ["h","e","l...
[3 replies] Last: If you mean a std::list and a std::string, something like std::list<c... (by Repeater)
January 2020 Pages: 123... 8
  Archived months: [dec2019] [feb2020]

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