General C++ Programming (Page 7)

move constructor
template <typename Type> my_unique_ptr<Type>::my_unique_ptr(my_unique_ptr<Type> && object) ////Mo...
[2 replies] Last: my professor sample code on move constructor was something like this (by appledog)
Read multiple text files bug
Hey, guys. Can u help me with the piece of code? So, I must read a text file that contains the name ...
[8 replies] Last: I've just changed the objects trying to use STL Vector and it is still... (by DrakonzJG)
Error in code Insertion in the begining of list
This is the code for insertion in the beginning of the list. #include<iostream.h> #include<pro...
[1 reply] : The compiler is giving 1 error saying that there is an error at line ... (by lastchance)
Dereference operator * that returns a reference to the item pointed by the object. Operator -> that...
[8 replies] Last: my_unique_ptr is a class template, so my_unique_ptr isn't a class in i... (by Ganado)
Can I have a template constructor inside a template class?
Hi, This does not compile but it should since other is an instance of a class template which in...
[1 reply] : One is a pointer to const and the other is a pointer to non-const. (by helios)
crossword puzzle generator (1,2)
Yes, there at time still a thread open at this topic, opened by @Merari
[22 replies] Last: Here a program version that pre-filters matching candidates. But it ne... (by nuderobmonkey)
by doug4
One more line of code I need to make it work
I would try this if (y == 0) { std::cout << "Cannot divide by zero. Operation aborted..." << s...
[7 replies] Last: And the spampost is gone :) (by MikeyBoy)
Output affected by placement of delete statement
Hello, I'm a computer science student and am working on a homework problem. I have already solved i...
[5 replies] Last: going out of bounds of a block of memory can cause any of many unpredi... (by jonnin)
Currency to words C++
Im trying to make a code that displays currency such as (312,12) in words (three hundred twelve doll...
[4 replies] Last: Thanks dutch for your help i was able to get the code working. after y... (by somedude)
do u know whats the difference between storage.swap(new_storage) and std::swap(storage,new_storage),...
[1 reply] : Typically, prefer the specialized a.swap(b) over the more generic s... (by mbozzi)
#ifndef FAST_QUEUE_H #define FAST_QUEUE_H #include <iostream> #include <vector> #include <algorithm>...
[4 replies] Last: thanks (by appledog)
Searching for a word in text file
Hi im trying to write a program that reads in a text file. The user can search for a specific word a...
[2 replies] Last: Maybe like this: #include <iostream> #include <fstream> #include <str... (by Thomas1965)
mod help
i have some variables. int first = shows the start of queue int count = size of my vector int number...
[1 reply] : #include <iostream> int main() { const int Capacity = 4; ch... (by dutch)
Bernoulli formula with more than one k
I want to make a program in which I calculate the probability with Bernoulli for multiple k's (for e...
[1 reply] : You shouldn't keep inputting new k values. Just input the maximum one.... (by lastchance)
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...
[16 replies] Last: It could still be possible to have O(1) splice with size. Like jonnin ... (by helios)
im getting an error when i was trying to test my code i got a main.cpp and a class main.cpp:5:13: e...
[1 reply] : You have to put an actual type in the <T> when declaring an object. Fa... (by Ganado)
if i have a vector a of size 10 holding 10 elements and another vector b of size 20 holding 10 elem...
[2 replies] Last: for anything you swap, the a becomes b, and b becomes a, FULLY, not pa... (by jonnin)
Trying to calculate with the Bernoulli formula
I am willing to calculate with the Bernoulli formula. For that I have made the following code: #i...
[8 replies] Last: Ah, duh. (by helios)
How can I print 2 line like this to console? 1 11 2 12 3 13 4 14 5 15 6 ...
[11 replies] Last: try this .... #include<iostream> using namespace std; int main() { ... (by aniksh44)
vector help
i have a vector<Typename> which is a container with unknown amount of elements. i have a int first =...
[1 reply] : Is this a continuation of: (by keskiverto)
Pages: 1... 56789
  Archived months: [may2020]

Cannot post in this page. To post a new message, go to the first page.