• Forum
  • General C++ Programming

General C++ Programming

by admin
Welcome to this board!
 
Welcome to the general programming forum in C++.com! In this forum, users can to talk about any top...
[no replies]
by volang
Size of a forward_list
 
I dont want to keep track of its size on my own, so I wonder if I instead can update a member varia...
[9 replies] Last: It sounds like you're saying that it's stupid to worry about the smal... (by helios)
by volang
Map or unordered map?
 
I have a map where the order never matters. The only important thing is that I get direct / fast a...
[7 replies] Last: That's true (except if you don't need access by key) The OP specific... (by dhayden)
list/array of constant pair values at compile time
 
How do we have a list/array of constant pair values at compile time so it would be passed as two arg...
[2 replies] Last: Something like this? enum MyEnum { enumValue1, enumValue2 }; class M... (by doug4)
for enum cannot work
 
Why is this not working enum L{ j, k, l }; int main(){ for ( int i : L) cout...
[2 replies] Last: That’s not how for loops work. You should try using a switch sta... (by itsArtem)
exceptions
 
template <typename T> T & FastQueue<T>::front(){ if (number_of_elements == 0) throw std::out_o...
[1 reply] : It's a type, not a value, so throw std::out_of_range(); . (by helios)
Need help on choosing laptop
 
Hello guys, i know it is C++ forum and ive been using this forum alot in the last month but now i n...
[2 replies] Last: Forget Intel up to now, AMD better, brighter future prospect, much che... (by abdulbadii)
queue/vectors
 
i have a vector<T> storage that is a container, lets say inside i got 1,2,3,4,5 with head at 1 and e...
[7 replies] Last: LMAO. You can use insert: http://www.cplusplus.com/reference/vector/... (by zapshe)
Loop
 
How can I print 2 line like this to console? 1 11 2 12 3 13 4 14 5 15 6 ...
[10 replies] Last: How can I print 2 line like this to console? #include <iostream> in... (by dhayden)
How to access member of vector of struct?
 
I have some struct like the followings: struct Pose{ double x; double y; double...
[5 replies] Last: Suppose there are 3 Aircraft in the a vector. You say you want to c... (by dhayden)
One more line of code I need to make it work
 
My program inputs two integers and determines if the first number is a multiple of the second number...
[2 replies] Last: https://myloweslife.onl/ What does the Lowes employee portal have to... (by dhayden)
BIG O
 
You have the following piece of code: for(int i{0}; i<SIZE; i++) for(int j{0}; j<i; j++) ...
[4 replies] Last: Going with malibor's thought that a is related to N, the big-o answer... (by malibor)
Implementation of those I/O functions in C
 
int scanf ( const char * format, ... ); int printf ( const char * format, ... ); // and also sscan...
[7 replies] Last: are you asking how to use variable length arg lists in a function? tha... (by jonnin)
by frek
Define all essential operations or none for a class
 
Hi all, If we rely on the rule: Define all essential operations or none for a class , when are we ...
[7 replies] Last: [quote=frek]I've heard that we do that when there's a resource in the ... (by Cubbi)
by Ema00
Login function
 
Hello everyone, in the code below I tried to make a simple staff management program for school, I wa...
[5 replies] Last: I want to insert the Login function to appear when the program compi... (by MikeyBoy)
I need help!
 
So, I'm currently in the process of learnign C++. I am eventually going to be using unreal. I want t...
[2 replies] Last: You can go to codingame.com to look for puzzles to solve, though they ... (by zapshe)
by volang
check the size of key/index that doesn't exist?
 
I have a map <int, vector <string>> mymap Is it safe to check the size of key/index that doesn't...
[4 replies] Last: You can check, whether key/element exists: http://www.cplusplus.com/re... (by keskiverto)
&& not working as expected
 
For my assignment I have to take sets of 3 integers separated by spaces from the user input and dete...
[1 reply] : Let's say x == 1, y == 2, x == 0 When you use "&&", that's the and o... (by doug4)
constant in a member function to be assigned to global variable
 
How can we assign a constant in a member function to a const or non-const global variable (each with...
[2 replies] Last: I'm not exactly sure what you are asking. Does this code snippet cove... (by doug4)
by volang
Why member string acts different from member int
 
struct a { string c; a(string x) { c = x; } }; int main() { ...
[9 replies] Last: keskiverto this was very helpful. Thanks alot (by volang)
Pages: 123... 11
  Archived months: [apr2020]