49,761 Topics

Member Avatar for
Member Avatar for Gobbler

Hi all, I am very new so excuse the messy code. I am just trying to get this code to work properly first before cleaning it :p . For now I want it to: if user types "no" exit, if user types "yes" then run the next part, or if …

Member Avatar for jonsca
0
109
Member Avatar for lochnessmonster

I'm haveing a hard time determining wether i should implement certain things as a class or just functions....for example.... Log.h library <--- i could obviously implement a Log class....and i could also have use Log functions(without a class) alternatively...is there any guideline/recommendations i should use when knowing wether i should …

Member Avatar for mike_2000_17
0
113
Member Avatar for triumphost

Can someone help me with this? I No matter what I do, when I press F9, the message box pops up showing F9, But when I press F10, the message box for F9 pops up.. Is it because MSG msg and MSG msg2 are the same?? How do I fix …

Member Avatar for triumphost
0
135
Member Avatar for RapidFire4Life

Hi, I was given the following problem, I've almost got it but I've hit a roadblock and having no luck getting past it. Here is the problem im supposed to solve... The function insert of the class orderedLinkedList does not check if the item to be inserted is already in …

0
266
Member Avatar for timo86m

I am reading this book called "C++ From the Ground Up". I saw this and it makes perfect sense // Using a reference parameter. #include <iostream> using namespace std; void f(int &i); int main() { int val = 1; cout << "Old value for val: " << val << '\n'; …

Member Avatar for rubberman
0
165
Member Avatar for Clinton Portis

Trying to make a quick little tool in response to the [URL="http://www.msnbc.msn.com/id/42348642/ns/technology_and_science-security/"]FBI's request for assistance[/URL] on cracking a code.. getting an error that takes me outside the scope of my program.. not sure what is causing the problemo. Maybe another set of eyes can help: [CODE] #include <iostream> #include <fstream> …

Member Avatar for Clinton Portis
0
240
Member Avatar for sergent

Once I was trying to create an object inside a switch statement. It looked something like this. [CODE] cout >> "Enter how many objects you want to create: "; int nofobjects; cin << nofobjects; switch(numberofobjects) { case 1: objectclass object1; break; case 2: objectclass object1; objectclass object2; break; case 3: …

Member Avatar for WhiZTiM
0
191
Member Avatar for smitty34

[CODE]// Finals.cpp.cpp : Defines the entry point for the console application. // #include "stdafx.h" int _tmain(int argc, _TCHAR* argv[]) { #include <iostream> #include <string> #include <iomanip> using namespace std; // //CLASS DECLARATION SECTION // class EmployeeClass { public: void ImplementCalculations(string EmployeeName, int hours, double wage); void DisplayEmployInformation(void); void Addsomethingup(void); string …

Member Avatar for sergent
0
133
Member Avatar for eman 22
Member Avatar for eman 22
0
83
Member Avatar for maybnxtseasn

I am quite confused on the following terms...are all the following terms all the same way to pretty much say "nonmember function" ( function that works with a class that isnt apart of its public interface ) [B]auxillary function helper function free function utility function[/B]

Member Avatar for mike_2000_17
0
136
Member Avatar for DaniwebOS

I've been trying to think of the easiest way to calculate the average and display the results. The two outputs that I am missing would be the average part of the program. When the program is ran, it should display "Danika Patrick averaged a score of 120 in 11 minutes …

Member Avatar for sergent
0
102
Member Avatar for sergent

I don't understand why goto's are so bad. I LOVE to use it in an if-else or switch to quit a loop. But everyone says they are bad and I should not use them but no one says why! Can you explain it to me?

Member Avatar for arkoenig
0
541
Member Avatar for jeffpro

Hey guys I'm trying to make a directdraw program to output certain statistics but it's not drawing fast enough. Does anyone know how to increase ddraw update speeds? Thanks in advance!

Member Avatar for jeffpro
0
89
Member Avatar for CrumbledCookies

I don't fully understand what is wrong with my code, it will read the first lines of any text file but then overloads and keeps displaying "0.00" and then crashes the program. I'm trying to get it to read student's last names and read their GPA scores, and the sentinel …

Member Avatar for CrumbledCookies
0
2K
Member Avatar for Climber Ty

Okay here's what I have so far... The error I receieve is below... The HCP Header File [CODE] #ifndef HEALTHCAREPROVIDER_H #define HEALTHCAREPROVIDER_H #include "stdafx.h" #include <string> #include <iostream> using namespace std; class HealthCareProvider { protected: string fullName; string profession; int yearsExperience; string companyType; string apptAvail; double bill; double fee; public: …

Member Avatar for Climber Ty
0
154
Member Avatar for megaLU

Hello! I have written a nested for loop with an inner loop of 86400 iterations and the outer loop 365. It compiles and everything but only gives me 97 of the 365 results. This is the error message: [CODE]aqua(855) malloc: *** mmap(size=268435456) failed (error code=12) *** error: can't allocate region …

Member Avatar for rubberman
0
183
Member Avatar for ChaseRLewis

I know printf prints to "stdout" how exactly can I change the pointer to a class of mine that i'd prefer to handle the output string? or is it better to just process using sprintf and manage the strings? Would there be any issues with the first method?

Member Avatar for rubberman
0
87
Member Avatar for shauzi158

Hello everyone, i want to ask how do we allocate memory for 2D array using pointers with 2 different inputs of rows and columns? Furthermore, i want to know how do we access different members of that particular array through pointers?

Member Avatar for Ancient Dragon
0
111
Member Avatar for eman 22

[CODE] int main(){ // I have an error in the next line read_file("F:/2nd year_2/Data structure 2/books/lecture-26.pdf"); return 0; } string read_file(char* address){ string line; ifstream myfile (address); if (myfile.is_open()) { while ( myfile.good() ) { getline (myfile,line); cout << line << endl; } myfile.close(); } return NULL; }[/CODE] this program …

Member Avatar for eman 22
0
139
Member Avatar for altXerror

i have part of a text based game that keeps track of the HP , DEF... and such. it needs to be able to replace the current value for the variables, in which case are: [CODE]long HP, def, sheild;[/CODE] for instance, you battle a monster and the attack does 75 …

Member Avatar for daviddoria
0
86
Member Avatar for Ancient Dragon

I tried to write up a test program that uses std::copy and istream_iterator to copy one text file to another. But it doesn't work because the '\r' and '\n' in the file are lost. I've tried opening the input and output files in text mode and I've tried opening them …

Member Avatar for vijayan121
0
713
Member Avatar for brandonm

Hi all, I'm having an issue with updating an XML that already exists. I have no problem creating an XML but when it comes appending to the end an existing xml nothing happens. I dont get any error messages so I'm not sure what I'm missing, the first part where …

Member Avatar for brandonm
0
157
Member Avatar for caut_baia

Is this ok to do or have i forgot my manners?Thank you [code] struct A { virtual A* func()=0; }; template <typename T=int> struct B : public A { A* func () { return this; } }; typedef B<> B_int; typedef B<float> B_float; struct C : public B_int { A* …

Member Avatar for caut_baia
0
130
Member Avatar for jmalbornoz

Hi, I have been programming in C for some time and now I am trying my hand at C++. As we all know, global variables are baaaaad... However, I am developing a collection of classes and I need them all to share a common variable (a time step) whose value …

Member Avatar for jmalbornoz
0
3K
Member Avatar for dumb.king12

Write a program that will accept a text file and echoes all of the words to the terminal and places a single space character between consecutive words. Words are composed of alphabetic characters only. Your program should write only five words on each lin, separating words on a line by …

Member Avatar for Stefano Mtangoo
-2
113
Member Avatar for zaneulhaq

Hey guys i'll show the code first then explain my problem: [code=c] Class A { /*Variables required by A, B, C and D */ /*functions required by B and C*/ }; Class B { /*some of it's own functions and variables*/ }; Class C { /*some of it's own functions …

Member Avatar for Stefano Mtangoo
0
402
Member Avatar for Khoanyneosr

[CODE]// Hangman Redo Program #include <iostream> #include <string> #include <cstdlib> #include <ctime> #include <string> #include <vector> #include <algorithm> using namespace std; //Functions void instructions(); void game(); // Types and Arrays string choice; string inst; const int MAX_WRONG = 8; vector<string> words; const string THE_WORD = words[0]; string soFar (THE_WORD.size(), '-'); …

Member Avatar for jonsca
0
164
Member Avatar for fadi_1234

can anyone explain why the output of this code is 110 ? [CODE]// Assignment 1-Body Mass Index Calculator #include <iostream> //allows program to output data to the screen using namespace std; //function main begins program execution int main() { int total=0; for (int number =2;number<=20;number+=2) total +=number; cout<<"Sum Is"<<total<<endl; return …

Member Avatar for veda&&
0
90
Member Avatar for jmcginny5

So I have the program written, but for some reason, when I go to compile it, the display box pops up and then disappears right away. Can you please help me to figure out what I did wrong? [CODE] #include <iostream> #include <iomanip> #include <cmath> #include <string> #include <fstream> using …

Member Avatar for zaneulhaq
0
98
Member Avatar for c++prog

write a program to print how many times each word appear in the file.

Member Avatar for zaneulhaq
0
69

The End.