General C++ Programming - February 2019 (Page 4)

by elsa
Error: "Identifier "art" is undefined
 
How do I remove the error and output appropriately like the following? /* Output: ========================== ID: 12345 Title: The Kiss Artist: Gustav Klimt P...
[4 replies] Last: You need to move displayArt() outside of main. You can't define a func... (by dhayden)
Arduino programming
 
How do I write this kind of program using the Arduino Uno? "Write a program to manipulate the auto scroll with two of the buttons so that one button makes the d...
[2 replies] Last: [quote=cait300]How do I write this kind of program using the Arduino U... (by closed account z05DSL3A)
'stoi' was not declared in this scope
 
In int main(), I am getting the error message "stoi was not declared in this scope." Is there a way around using stoi? Thanks! #include <iostream> ...
[2 replies] Last: I'm going to guess you're on MinGW. Upgrade your compiler instead, new... (by Ganado)
Box type with value and pointer type of points (1,2)
 
Dear all, Box type (with minimum and corners of point type which contains x,y,z coordinates) is often used in programming. Sometimes it is useful to use v...
[20 replies] Last: Ah, yes, I misread the structure. (Apparently late night does bad stuf... (by Duthomhas)
queue vs deque
 
Hi all! I am sorry if this is a very basic question. I am developing a code that needs a FIFO container. At the beginning I was using a std:queue, but bec...
[3 replies] Last: Hi guys! Yes you are right, I did not realize that the underlying co... (by hebrerillo)
by helios
Call reordering?
 
Compiler: MSVC 2015 I was writing a function to measure CPU speed when I noticed something extremely odd: double measure_ratio(int divisions, int iterati...
[19 replies] Last: Heh. Fair enough. (by helios)
Why does defining a destructor prevent defining a move constructor?
 
Hi, Looking at this code: class T{ public: ~T(){} // dtor prevents move ctor // copy ctor is noexcept }; Supposedly the presence o...
[5 replies] Last: Ever heard of the rule of three/five? I know the question wasn't dir... (by closed account E0p9LyTq)
What do you do during compiling? (for professionals)
 
A question for professional developers. What do you do during compiling? A lot of time is spend during the compilation of code. Do you just wait and look ...
[3 replies] Last: Luckily the compile time for the main project I work on only takes aro... (by Ganado)
Need Help with Reading/Writing 2Vector of Structs
 
I'm not new to c++ programming but I am new to reading and writing information to and from a binary file in c++. I've grasped some of the basics of reading and ...
[3 replies] Last: But before you were saying that I would need to serialize each Direct... (by jlb)
how to prevent template argument deduction
 
In C++17, is there a way to prevent template argument deduction from a call to a call class constructor? In the following code, I define a template class with ...
[3 replies] Last: If you plan to use your template class only for a few types, you could... (by Enoizat)
multiple source files, header, global variable not working
 
Hi, I'm trying to write some code while having a global variable shared in all my source files. compiler is not happy about something. If i run it it gives me ...
[3 replies] Last: started from zero, copied code from here and pasted it on new files. n... (by billings)
please I need help with this assignment
 
Please, do not double post. It does not expedite the help. http://www.cplusplus.com/forum/beginner/250031/
[no replies]
Last element of an array is appearing different result in diff compilers
 
#include <algorithm> #include <cmath> #include <cstdio> #include <iostream> #include <vector> using namespace std; int main() { int n; int a ; int numbe...
[4 replies] Last: > Last element of an array is appearing different result in diff compi... (by salem c)
determine wether a year is a leap year
 
i have an assignment that asks me to input a year and then output if the yer is a leap year or not. #include <iostream> using namespace std; //prototypes voi...
[6 replies] Last: He’s using boolean expressions, which have a value of 0 or 1. You s... (by Duthomhas)
calculate the number of minutes in a year.
 
I need help with my c++ university assignment the assignment want us to write a code that calculate the number of minutes in a year can u help me please?
[4 replies] Last: why would he need command line args for this? as with any program, ... (by jonnin)
by elsa
Unresolved errors in main: "type name is not allowed"
 
As the title suggests, I am having errors: on line 59, 63 and 65. They are "identifier is undefined" (lines 63 & 65) and line 59 is "type name is not allowed". ...
[2 replies] Last: thank you - this resolved all my errors. And in the process I learned ... (by elsa)
what's the type of a lambda expression ?
 
I have written some code using template classes that take a function or functor type as a template parameter and functor or function as a constructor parameter....
[3 replies] Last: Thank you very much. With std::function, I was indeed able to define ... (by CABrouwers)
what is the difference between returning decltype(auto) and returning only auto?
 
What is the difference between these 2 functions: decltype(auto) doitDA(int a, char c, bool b) { return (a + c + b); } auto doitA(int a, cha...
[1 reply] : https://stackoverflow.com/questions/24109737/what-are-some-uses-of-dec... (by dutch)
Activity Diagramm
 
Hi Guys ist the the Activity Diagramm drawn write of the following code ? https://s16.directupload.net/images/190217/2xon3ogj.png https://s17.directuplo...
[3 replies] Last: I don't know what you're allowed to put in an Activity Diagram so it's... (by dhayden)
What is "Expected primary expression before..."?
 
The following is what i have typed up. i am not finished but basically i am trying to enter a temp in celsius and get an estimated windchill index. but when i t...
[6 replies] Last: Imagine a real-world situation, how would you design the program? That... (by CABrouwers)
February 2019 Pages: 123456... 11
  Archived months: [jan2019] [mar2019]

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