General C++ Programming - May 2015 (Page 20)

Problem using a Loop with Classes
 
Hi, I am trying to loop 5 something times. The loop number would update what it is working on. For example is there a way to make the loop put the values 1-5 af...
[4 replies] Last: I was thinking I needed an array but all the constructors have differ... (by andywestken)
Design a program for a trucking company that has seven trucks in its fleet.
 
Design a program for a trucking company that has seven trucks in its fleet. Each truck is identified by a number from one to seven and has a maximum weight allo...
[no replies]
boost serialization
 
Hi, I have something like this: ...//header files class A{ private: std::vector<uint16_t>r; std::vector<uint8_t>s; std::vector<float>t; public: ......
[1 reply] : Have you read the tutorial? http://www.boost.org/doc/libs/1_58_0/libs/... (by TwilightSpectre)
expected unqualified-id before 'switch'
 
Hello everybody! I try to resolve my problem in this code: #include <FastLED.h> #define NUM_LEDS 16 #define DATA_PIN 3 #define CLOCK_PIN 2 CRGB leds ...
[2 replies] Last: Great! Many thanks! YOu r the best) (by woodbras)
Output not showing up in textfile when using out_data
 
This program takes code from a file cost.txt and output some calculations and then writes the output to a file cost.out cost.txt looks like this Books 45.01...
[1 reply] : It is indeed from the line you mentioned. for (int cat = 0; cnt <cou... (by konstance)
Start w/o debugging outputting different results than debugger
 
Ok, so I'm new to this posting for help on a forum deal. I've searched and searched, but can't seem to find why I'm running into this issue. I'm working on a...
[2 replies] Last: Thanks Gamer2015, such an obvious answer, yet for whatever reason I wa... (by themrpeanut)
by Ozzy69
How allocate dinamic an array in real time?
 
Hi I liked of allocate dinamicing an array in real time, but be giving error! This is my code: #include <iostream> using namespace std; int main() { int ...
[2 replies] Last: Sorry..... I repaired the code (by Ozzy69)
help with virtual print function
 
Hi, for my assignment I needed to create a virtual print function in my base class. Eveything seems to work except the printing part. When it loops through th...
[2 replies] Last: Once declared virtual in a base class, the function is automatically v... (by andywestken)
Trying to get a function to return an input
 
On line 35 I'm trying to return the int incrd which the user has inputted but i get a window which pops up saying: Run Time Check failure #3 - the variable "in...
[3 replies] Last: Another take? Use mod (%) and integer division (/) to chop the input ... (by andywestken)
a program that shows whether characters/words entered by user are palindrome or not
 
Write a function isPalindrome (and the main() function to test it) that takes as input a word and returns true if the word is a palindrome or false otherwise. ...
[no replies]
Performance goes down in multithreading
 
#include <ctime> #include <vector> #include <iostream> #include <thread> typedef std::vector<int> VecInts; void update(VecInts::iterator first, VecI...
[1 reply] : Your computer can probably do roughly 2 billion calculations per secon... (by ultifinitus)
Quick Question: Does a Derived Class have access to private members of the base class?
 
Same thing with inheritance. When you inherit a class, does private/protected members also get derived and/or inherited? Thanks!
[2 replies] Last: @ fg109, Thanks for the link! It was very helpful :) (by newbiee999)
by Kyi
Verb, Noun Checking Program Memory error
 
Hey I am having trouble with this code. I am pretty sure the code is right but when I run it, the following error "Unhandled Excpetion at 0x76A24B32 in'consolea...
[4 replies] Last: PS Just occured to me, as you're using cin for input, which breaks st... (by andywestken)
Conversion functions?
 
I was surfing in the internet and found that class: template <class T> class Ptr { private: T * rawptr; public: struct PointerConversion { int valid; }; ...
[2 replies] Last: Thanks for replay. First one should be correct. Purpose of this class ... (by TheHardew)
What's wrong with my code ?
 
Hello every one I'm a beginner in c++ , and i'm trying to create my little ATM program I started with simple program that's accept only one account for one ...
[1 reply] : #include "bank.h" Account::Account(){ int i=0; cout << "To create... (by Faresisteiger)
by Ozzy69
How make to the put numbers randons in array in c++
 
I wonder how is to ask the user the random number of arguments. Because if u wanted eg only three numbers, so u put int a, b, c; cout << ""; cin >> a >> ...
[7 replies] Last: > when you use the cin.peek() don't print the last number, The last n... (by JLBorges)
by Ozzy69
How copy elements of a container for the other container?
 
Hi, How copy elements of a container for the other container without a loop, because i have that change this code: vector<int> vetor; vetor.push_back(2); ...
[2 replies] Last: Thanks! (by Ozzy69)
strange std::bad_alloc error
 
When I add the following code ,the memory increase dramaticly ,finally the error occurs:std::bad_alloc. But I can not find the overflow, Can anyone show me the...
[2 replies] Last: when I add the assignment operator,the memory is also increasing! t... (by zhaolewen)
De-referencing the last iterator position
 
Suppose I have a vector<int> v1 = {some set of integers} and I want to add the 0 and the last index, 1 and the last - 1 index, and so on. How can de-reference t...
[5 replies] Last: > j will be larger than it. j is not an iterator; it is a number of... (by JLBorges)
C++ School Project Final Ideas?
 
I am supposed to make a final project for my C++ class with the following rubric: It needs to have - Function Calls Boolean Logic Statements Variables Loops Ar...
[1 reply] : I am supposed to make a final project for my C++ class with the follo... (by hyperfine)
May 2015 Pages: 1... 1819202122
  Archived months: [apr2015] [jun2015]

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