General C++ Programming - November 2014

How to start a Printer queue?
 
Write a program to simulate a printer queue (priority queue or heap – Bentley article has code) where 3 printers are “fed” by this queue. Each print job ...
[1 reply] : Your indentation sucks, so I'll say no. > Write a program to simulat... (by ne555)
by kiana6
Many errors
 
There are many errors in this code. Can someone please fix them for me? I'd really appreciate it. #include<iostream> #include<string> using namespace std...
[2 replies] Last: http://www.cplusplus.com/forum/general/149343/ and scroll down... I ... (by aarnold404)
by Nanyo
functions
 
hello, does anybody know why I get error on line 14, it is about the left operand or something. #include <iostream> #include <string> using namespace ...
[10 replies] Last: I see now. Thank you very much!!! (by Nanyo)
cut off zeroes from double datatype
 
hey I just wanted to know a way to cut off any remaining zeroes from a double data type. I' trying to calculate cost and output it but it keeps adding a bunch o...
[1 reply] : Check out setprecision() in <iomanip> http://www.cplusplus.com/refere... (by wildblue)
Help with writing a program
 
Hey, so this is the question: Write a program that reads a group of chars till $. Then, compute # of vowels, # of digits, # of word and # of special chars. ...
[13 replies] Last: If you take the if..else out of the while loop, it's only going to run... (by wildblue)
by fafner
SDL delta time
 
I'm trying to get smooth sprite movement in SDL by using delta time. The way I'm calculating it is long last = 0; float deltaTime = 0.0; ... long now...
[2 replies] Last: Yep, that was it! Thanks :) (by fafner)
by emnaq3
How do I read an interger file up to a specific character?
 
Hello, I just joined the C++ community to get help and help others if I can. I currently have an assignment where I need to read 4 things from a file. 1.Bank...
[3 replies] Last: yes stof (by csstudent123)
Dynamic Array Allocation
 
I have just started working with pointers so bear with me. I was doing a side programming challenge in my workbook that asked me to dynamically allocate and arr...
[5 replies] Last: maybe because on the last pass of the loop it is incrementing ptr agai... (by aarnold404)
Pointer To The Last Node Of A Doubly Linked List
 
Why is it sufficient to only have a pointer to the last node of a doubly linked list?
[1 reply] : Because you can reach any oher node from last one. Actually it is suff... (by MiiNiPaa)
by mia123
TIC TAC TOE HELP
 
THANKS
[1 reply] : please use code tags <> I need to show the computer(X) always go fir... (by anup30)
Moving object in c++
 
Hi everyone. I need your help I want to make an object in array move Ex: array array = 'O' O| | | | | | | | | | | | | | | then |O| | ...
[1 reply] : #include <iostream> using namespace std; int main () { char a ; fo... (by anup30)
Maintaining an additional pointer to the first node in a doubly linked list
 
Why would it be cumbersome to maintain an additional pointer to the first node in a doubly linked list?
[1 reply] : It is not cumbersome at all. Most implementation of doubly linked list... (by MiiNiPaa)
error: command don't work
 
hi everyone. I'm study c++ and I wrote a short code but it didn't work exactly. Every command under "demo(f);" not work. I don't understand why it's so. Please ...
[2 replies] Last: Now, I understood this problem. Thank you very much! (by khanhdt6)
not declared in scope...function problem?
 
#include <iostream> #include <cstring> #include <cctype> #include <string> #include <cstdlib> void askForName(string& name); //Request for username ...
[5 replies] Last: I'll read into it. This is the way I've been doing it in school for my... (by Squeaks)
try-catch summary
 
Sorry for asking so frequently as I got final exam this monday... Pls correct me if I am wrong when I say: try { throw ... } catch (param){//co...
[4 replies] Last: thats the example I saw but its clear btw, ... (by csstudent123)
by Myna
How do i start this one?
 
The objective of this project is to implement bubble sort algorithm. You need to perform the following steps: ● Create an integer array of 10 elements. ● Ge...
[1 reply] : What have you written so far? You forgot to ask a question. (by LB)
Trying to pass a double pointer of an object into a node of self similar type?
 
Hello, The following code compiles and runs fine till it reaches line 16 and gets a sigsev violation which I'm not sure about as to why. I have no problem pa...
[3 replies] Last: [quote=lostwithcpp]This part doesn't create an object? (this->copy) ... (by LB)
Binary file - replace data at specific point
 
I'm making a binary file that has 100 "empty spaces", and then I want to rewrite specific place with info, however it always writes the info at the end of the f...
[5 replies] Last: The only time the file is erased when you open it is if you specify ... (by LB)
vending machine function weird output
 
Hey all so I got a vending machine program and I'm having trouble with this last function to calculate and give back the change. I am passing by referance the n...
[1 reply] : cout << "you get back " << returnQuarter << " quarters " << returnDi... (by wildblue)
<list> iterator error when including "upperclass.h"
 
Hi, I have a project with two (involved) classes. A "lowerclass.h" and a "upperclass.h"(has a std::list of lowerclass elements). Until now i only had included ...
[2 replies] Last: Thanks Dean! I had to declare them both before each other. Didn't kno... (by nonsence90)
November 2014 Pages: 123... 32
  Archived months: [oct2014] [dec2014]

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