General C++ Programming - June 2020 (Page 6)

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 need help with choosing laptop. Laptop uses: 1.Gaming 2.Progr...
[2 replies] Last: Forget Intel up to now, AMD better, brighter future prospect, much che... (by marhuum)
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 end at 5. i want to remove 1 but i dont want to use .erase in...
[7 replies] Last: LMAO. You can use insert: http://www.cplusplus.com/reference/vector/... (by zapshe)
How to access member of vector of struct?
 
I have some struct like the followings: struct Pose{ double x; double y; double orientation; } struct Aircraft{ Pose pose; do...
[5 replies] Last: Suppose there are 3 Aircraft in the a vector. You say you want to c... (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++) sum*=matrix ; A) How many multiplications wil...
[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 sscanf, ssprintf, fscanf, fprintf, etc. How to implement these?...
[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 to decide to use each? I mean, when must we define all 7 fun...
[7 replies] Last: [quote=frek]I've heard that we do that when there's a resource in the ... (by Cubbi)
I need help!
 
So, I'm currently in the process of learnign C++. I am eventually going to be using unreal. I want to create a program so that I know I'm actually learning not ...
[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 exist? Lets say index 24 is not created, then... if(myma...
[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 determine whether or not they can form a triangle, and if so whe...
[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 its own way explained)?
[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() { map <int, a*> m; m = &a("hej"); cout << m ->c...
[9 replies] Last: keskiverto this was very helpful. Thanks alot (by volang)
I need help inputting true or false to my trivia question
 
I wrote a program that asks the user to enter true or false to a trivia question. I learned that standard cin just inputs 1 or 0 for true and false. I want t...
[3 replies] Last: I didn't know that one. If you want to accept something else, like "y... (by jonnin)
Vector or screen displacement (1,2)
 
Hi Guys, I'm reading Stephen Prata's C++ primer plus, I'm 535 pages deep into the book, so far It's a great book clear and precise explanations with excellent ...
[31 replies] Last: The whole point of p535 is operator overloading and not how the x and ... (by againtry)
const_cast
 
why I should used const_cast instead of 'C' style casting? C style: const char* str = "String"; char* str1 = (char*)str; str1="changedString"; ...
[18 replies] Last: there is nothing 'wrong' with it but to cast a freaking double to an i... (by jonnin)
Complete Developer Podcast: Static Code Analysis
 
A new episode of Complete Developer Podcast where Yuri Minaev, C++ developer at PVS-Studio, talks about static code analysis, the PVS-Studio analyzer, and his w...
[no replies]
by helios
Strange linking error at runtime
 
This is my Makefile: ../ImageLibrary.dll: export_functions.o FreeImageStream.o ImageFunctions.o LibraryState.o c++ -std=c++14 export_functions.o ImageFunc...
[6 replies] Last: Are shared objects not fully linked like DLLs are? When you build a DL... (by helios)
Adding a random number 1-100
 
Hi so I'm working on inputting a text file then outputting a another file that has a random number 1-100 here is how my input file would look like: Student1 B-t...
[1 reply] : > day = rand()%100+1; How many times are you calling this in your code... (by salem c)
June 2020 Pages: 1... 456
  Archived months: [may2020] [jul2020]

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