Beginners - February 2019 (Page 4)

How to remove an array's element using Delete operator
 
So I have a dynamic array. I know the exact position of the element(s) I want to remove from that dynamic array. my dynamic array: int *data = new int ;...
[10 replies] Last: there are 3 or 4 standard ways to 'delete' from an array. 1) you can ... (by jonnin)
Template help
 
How would one implement this: printContainer<Set>(words.begin(), words.end()); as a template class ?
[1 reply] : What you've provided is a function that belongs to a class template. ... (by fiji885)
Dynamic Array
 
#include <iostream> #include <string> using namespace std; int main() { int l; cout << "enter number: "; cin >> l; string* x= new string ; ...
[5 replies] Last: got it Thank you (by Jack Van Stone)
Help on loops
 
Currently when I run my program, it will output all three results no matter which choice you pick. So if I were to say I want a Gold membership, it will output ...
[2 replies] Last: Thank you so much! It makes a lot more sense with your idea of e, I do... (by alexandrap98)
Query about using #define directives
 
I realize the method below maybe isn't how one would usually go about setting up #define directives, but I'm wondering why I get the results I do: #include <...
[12 replies] Last: That has nothing to do with it being not type-checked, though. You can... (by helios)
Copy Constructor for complex classes
 
I am familiar with the simple copy constructors, and it worked fine with classes which members are primitives as strings or integers. However now I am trying...
[10 replies] Last: [quote=clepina]It is probably because I have pointers in my classes T... (by AbstractionAnon)
by Majeek
Variable Sized Object May Not Be Initialized
 
I'm pretty new to classes and I'm trying to store data into each bunny created (Name, Age) But for some reason when I try to do std::string NameBunny = Rando...
[4 replies] Last: Thanks! (by Majeek)
How to use std::quoted with string?
 
Hi, I know that std::quoted is able write its output to the stream, but is it possible to use it with a string? #include <string> #include <iomanip> ...
[18 replies] Last: If P1479 gets accepted you'll be able to write std::to_string(std::qu... (by Peter87)
space erase
 
Hi, I am trying to write a program that erase trailing and front spaces of a string. The code I came up with does something weird instead, it repeats the inp...
[10 replies] Last: this might help you: #include <iostream> using namespace std; int mai... (by ronny131)
by ramp00
Constructor error
 
Why do I get the error "no default constructor exists for class "Face"? I thought the Face(Point c, int r) function was the constructor in Emoji.h, and the Emp...
[4 replies] Last: I see, I see.. Thanks a lot! (by ramp00)
Compiling old code failing at struct command
 
I am (attempting) compiling something from 2016 and the compiler (Cinder) has changed a bit since then...the code is choking on this... struct Cursor { ...
[3 replies] Last: Followup... You shouldn't attempt to code when tired. I mentioned th... (by youbecha)
Questions about Quick Sort with the middle pivot
 
Hello everybody. Please help me with the following problem: I am learning algorithm Quick Sort. My teacher said that if I choose the middle pivot, there are ar...
[4 replies] Last: Today, I met him again, watched the source code he wrote, and discover... (by cegodica)
by Bopaki
There is something seriously wrong with my C++ compiler today
 
I have just installed codeblocks 17.2 and I get the above message on the build log. and then nothing happens. Any help would be appreciated. #inclu...
[3 replies] Last: Well, the cb_console_runner should show up as a pop-up... not sure wha... (by Ganado)
several functions
 
Hi, unfortunately I feel a bit lost. I am supposed to write a program by first of all declaring all the functions needed and then adding functions definition...
[3 replies] Last: I usually put {} on one line statements as well, as a style thing, wit... (by jonnin)
by cash
only function calls in main
 
My code shouldn't have any calls in the main other than function calls. However, I keep on getting errors when I try. How should I properly do it? #in...
[5 replies] Last: Salem's answer isn't bad, though. Turn old main into a function. Ca... (by jonnin)
Difference between throw and throws
 
I am trying to learn what is the difference between throw and throws, was unable to find code explanation online except in Java style... could someone provide m...
[3 replies] Last: It's a keyword that has been proposed for a new type of exceptions ("Z... (by Peter87)
by yat89
insert function
 
Hi everyone. I'm new to c++. Currently I'm doing project on vehicle routing problem in waste collection. Given 4 set of routes as follows: 0 3 4 5 6 7 8 9 1...
[5 replies] Last: Hi Handy Andy and ne555 , I had made some improvement to my code. ... (by yat89)
Modifying Records and delete
 
Okay so I'm working on a program that is supposed to modify, delete, and add records I have written some of the programs but I was curious if I'm going in the r...
[1 reply] : Consider a couple of utility functions. bool readMusicLine(ifstream ... (by salem c)
Read from TXT file to data structure
 
I trying to create a program that takes a file that consists of an amount of Employees, then each employee ID, First Name, Last Name, Amount of Sales, and then ...
[1 reply] : Before you get to assigning anything to your struct, start with ... (by salem c)
Sorting strings by alphabetical order (in an array using a struct)
 
Please Note: I did post a question already for this assignment, however , this is a new question and my code has changed a lot since the original post so I fel...
[9 replies] Last: Ah okay, yeah probably. Thanks (by PiggiesGoSqueal)
February 2019 Pages: 123456... 23
  Archived months: [jan2019] [mar2019]

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