General C++ Programming - October 2014 (Page 17)

problem with function
 
solved
[3 replies] Last: thank you! (by Stephanie)
Reading from a file
 
Having some trouble with an assignment. Here is the prompt. Write a program that reads the telephone.dat file and displays its contents on the console. The pro...
[15 replies] Last: I've got it solved. Thanks a ton. You tip helped in a big way. (by CompSciLoser)
How to have a unique array for each object
 
I have a program where I need to read in from a text file and use a character array to make a Word object. I want each Word object to have its own variable call...
[no replies]
difference between constructor and new/malloc , difference between destructor and delete/free
 
What is the difference between the following- a] constructor and new/malloc? b] destructor and delete/free? And what are the general rules to take care o...
[1 reply] : What is the difference between the following- - A constructor is a... (by Disch)
by bwoo
Need help involving vectors and classes
 
I am having trouble putting data from a txt file onto a vector of a class. For instance. class employee{ setname(string) { some code } getname () { ...
[10 replies] Last: yea, same issue. Doesn't compile correctly (by bwoo)
Reading in a text file into a char array
 
I have a project which is about linked lists in the order of: a Story is made of Paragraphs which is made of Sentences which is made of Words. We must treat Wor...
[2 replies] Last: @Keene That's a fantastic solution but does that method fall into a C... (by TommyK154)
While Loop help
 
I was wondering if someone could show me how to set this "while loop" problem up. I am sort of new to c++ and would appreciate any help. here is the progra...
[1 reply] : while( score != -999 ) { // get score from user // if score !valid ... (by Esslercuffi)
If Else Statment with ctime condition
 
I am try to make a menu for deliver order program. The menu divide into 3 group which are breakfast, lunch and dinner. However breaker only available at 6.3...
[4 replies] Last: #include<ctime> // Get current time // if, switch... (by nightmaregiba)
I need a hand in some C++ codes :(
 
1- Using the switch statement, write a program that allows the user to convert either from degrees Celsius to Fahrenheit or degrees Fahrenheit to Celsius. Use...
[2 replies] Last: it too simple... try to do it switch() if().... (by nightmaregiba)
Linked List adding nodes..
 
Ok so I am having difficulty adding nodes to my linked list.... Can someone give me an example of how to add a third node while keeping track of the address....
[1 reply] : can someone please help me out. (by novelloff)
Finishing Parking Garage program
 
I'm stuck on an assignment, and I don't understand how to finish implementation. I've been told that I have the majority of what I need, but nobody can help me...
[2 replies] Last: You may want to consider another class. Something like GarageEvent . ... (by booradley60)
by Ceset
include Macro
 
Hi guys. Everytime i create a class header like #IFNDEF BLAH_H #DEFINE BLAH_H #include "foo" #include "bar" class Blah{ }; #ENDIF And if i add it like #...
[4 replies] Last: So simply put, there is no way :) Thanks for all the answers anyway. ... (by Ceset)
by meesa
[Discussion] Dealing with signed unsigned mismatc
 
There are many questions on the web on how to fix a specific signed/unsigned mismatch, and the solution is usually just making one variable unsigned. However, I...
[13 replies] Last: Yes, as debugging aid. Not as only check. My statement Its only use i... (by MiiNiPaa)
constructor in inheritance
 
#include <iostream> using namespace std; class a { int b; protected: a() { cout<<"in a constructor"; } }; cla...
[10 replies] Last: ok thanks my friend (by sajid dayer)
by Glaven
Finding Smallest Number in Array Help!
 
Hi , I was assigned to create a program that has a 10 x 8 two dimensional array and fill it with random numbers in the range 50 to 70 inclusively.( Got That pa...
[2 replies] Last: how would u do that? would mind showing me in my code? (by Glaven)
by Agent
Template function specialization with default template arguments within template class
 
I'm getting the following error on Visual Studio: error C2783: 'R TestClass<char>::foo(void) const' : could not deduce template argument for 'R' With this cod...
[1 reply] : If you're writing a function template, prefer to write it as a single... (by JLBorges)
by Nebur
Compare function on sets
 
Hello, How can I declare a set of strings that i want to be ordered by a boolean function Comp? Like the one you would write in sort(v.begin(), v.end(),...
[4 replies] Last: Most people here lacking mind reading abilities, so text of that error... (by MiiNiPaa)
by arezu
URGENT HELPPP
 
#include<iostream> #include<cmath> using namespace std; int main() { int count=1; int divisor=2; double x,squareRoot; cin>>x; squareRoot=sqrt(x); ...
[3 replies] Last: Yep, that wasn't his only problem though... (by tmason)
virtual function in c++ and inheritance
 
#include <iostream> using namespace std; class a { public: virtual void add() { cout<<"class in a "; } }; class b:public a { void add(...
[3 replies] Last: @JLBorges i understand thanks (by sajid dayer)
Confused with threading in classes
 
Hello, I'm quite new to c++, but not to programming. I recently wrote a small program demonstrating the use of multithreading in c++, but as I ported it into...
[2 replies] Last: Thanks for your answer. (by Turakar)
October 2014 Pages: 1... 1516171819... 38
  Archived months: [sep2014] [nov2014]

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