General C++ Programming - February 2020 (Page 2)

by Denvor
help with these functions?
 
hi i am stumped with these functions i have attempted them but i am not getting the results that it should be this is the driver #include "mylist.h" #include ...
[2 replies] Last: Since all you said was that you aren't getting the results you expect,... (by doug4)
by qwerz
Alter a basic string in memory
 
Hey, Hope I can get some help with this basic string struct. I'm hooking an unknown function which has some sort of basic string as a parameter. This paramet...
[4 replies] Last: Line 20 in your original post should be if (strlen(str) < 0xf) In ... (by dhayden)
by Denvor
please help with this loop
 
i wrote this code and it works but it only asks the user to pick a seat once and then it assigns the seat and the code ends.i want it to ask over again untill m...
[2 replies] Last: Turn your main() into a different function. Create a new main() that c... (by dhayden)
send multiple pics from folder via socket (1,2)
 
I would like to start a fresh thread in order to solve this issue that has been going for awhile. I am trying to send all the pictures from a folder via so...
[30 replies] Last: > this confuses me. The 'send' command is inside a loop, so is not sen... (by salem c)
How do I insert lines in the middle of a file
 
I'm trying to write a program that edits this .json in a noob-friendly way. I need it to put lines in between lines. What is the easiest way to do this?
[4 replies] Last: You open the file that you want to read from, and you open a file to w... (by Repeater)
by Denvor
i cant figure out the problem
 
hi im stuck as to why when i run the programme only the 'q' and 'm'command work and not the rest. ifndef BOARD_H #define BOARD_H class Board { public: ...
[2 replies] Last: when i run the program and the menu pops up no other command works onl... (by Denvor)
compiling error
 
#include <iostream> using std::cout; using std::cin; using std::endl; please help this code is part of a class i have but when i try to run it it says undefin...
[1 reply] : Note that c++ is case sensitive: docommand(...) is not doCommand(...... (by coder777)
What is the name before modern cpp?
 
We say c++ as modern C++ from C++ 11. And then what should I say before C++ 11? Core c++? just c++? I want to know exactly how people say
[12 replies] Last: The previous model of C++ updates was effectively "when it's ready". T... (by Repeater)
Monthly totals from a sales report file?
 
#include<iostream> #include<fstream> #include <string> #include <sstream> #include<vector> using namespace std; void writeFile(); void readFile(ifstream &in...
[5 replies] Last: Did you even read my comment? I said "replace this istringstream with ... (by Ganado)
help with class
 
hi am finished with my functions for the class but i am having trouble figuring out how to implement them in main o get the results i want my program is suppose...
[2 replies] Last: Reservation::Reservation() { seats = 10; plane = { 0 }; } o... (by ne555)
help with this function
 
hi can someone please please assist me i am unsure of what to do for function movePen() function movePen moves one space in the direction that is currently bei...
[1 reply] : Maybe something like this. Note that your constructor can be simplifie... (by dutch)
Lambda Behavior
 
Hi All , I am trying to learn Lambda in CPP. With the following code I am expecting an output Hello World! #include <iostream> using namespace std; int...
[3 replies] Last: Thx All , My bad , I forgot that end of the day its a function and ne... (by NiharRNanda)
Simple Divisibility Rule Checklist Problem
 
Hello, I am having an issue printing the result of a program in which a number tests for divisibility by 11. Here is the code. I was wondering if anyone can ...
[2 replies] Last: #include <iostream> using namespace std; int main() { int n; c... (by lastchance)
by eladb
Function call
 
hello All, I would like to understand what is the differnt between both of following calls - Get(arr, size, find) = 13; Get(arr, size, find); what is mea...
[1 reply] : The function could return a reference, in which case whichever variabl... (by lastchance)
Errors on GetGraph with no global operator
 
Error C2677- binary ">>": no global operator. How to fix those errors? template<class V, class W> void Graph<V, W>::GetGraph() { edgeRep<V, W> G1; ver...
[1 reply] : Also here -> https://www.dreamincode.net/forums/topic/418489-how-does-... (by salem c)
by Sid321
Functions
 
I NEED HELP WITH THIS PROBLEM!!! Create a simple calculator using Function. The program should take an arithmetic operator +, -, *, / and two operands from t...
[7 replies] Last: #include <iostream> using namespace std; int calc(float first, char ... (by againtry)
Read two files but in two ways and the point where they entry can terminate with '#'
 
How can I read the two files and how will the entry be terminated with '#'? I don't know what I'm tried for at this point. //*******************************...
[3 replies] Last: I edit some of yours but... it's almost. There are a couple of lines t... (by mlanuri10)
initializing an array
 
I want to create a function called reset which will initialize array myIntArray so that the value of each location will be the value of its index. For example...
[2 replies] Last: A simple example without the added expense of being in a class. The m... (by George P)
std::future::wait_for example not producing any dots
 
When I select "Edit & Run" for the example given on the wait_for reference page and I run it on cpp.sh, I do not get any '.', which suggests to me the wait_for ...
[2 replies] Last: Runs under macOs Xcode and ideone online, but not coliru online. (by againtry)
Finding average of inputs using vector
 
In a loop, ask the user for integers If the user enters -1, end user input Use an input validation loop to make sure the user input is 2 or greater Append the v...
[3 replies] Last: here's another program I wrote tonight that correlates with these conc... (by Toddinator716)
February 2020 Pages: 1234... 7
  Archived months: [jan2020] [mar2020]

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