49,757 Topics

Member Avatar for
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
86
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
707
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
396
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
Member Avatar for ChaseRLewis

I'm starting to write more intricate code that does some dynamic compilation through Lua and OpenGL. However, my code is starting to get kinda messy because I have many const char* strings and strings in sections of my code so they can be parsed together properly depending on specific conditions. …

Member Avatar for ChaseRLewis
-1
113
Member Avatar for stereomatching

[code] std::tr1::array<double, 10> alpha; std::iota(alpha.begin(), alpha.end(), 0); using namespace boost::accumulators; size_t const SIZE = 1000000; accumulator_set<double, stats<tag::mean, tag::lazy_variance > > acc; std::for_each(alpha.begin(), alpha.end(), [&](double const VALUE){ acc(VALUE);}); [/code] How could I clear the contents of the acc if I want to evaluate a new mean and variance? Thank you very …

Member Avatar for vijayan121
0
869
Member Avatar for maybnxtseasn

i am injecting a dll into oneo my process's and i want it to read the bytes of the file and write those specified bytes to a file on hard disk. The problem is my .dll compiles, but when the .dll isi njected, it never creates the file and writes …

Member Avatar for Ancient Dragon
0
94
Member Avatar for wildplace

i have a header file defined as : [CODE] template <typename NodeElement> class Node{ //public members public: something here..... private: }; template <typename ListElement> class List{ public: something.... Node *nodePtr; //problem here }; [/CODE] [CODE] list.h:38: error: ISO C++ forbids declaration of ‘Node’ with no type list.h:38: error: expected ‘;’ …

Member Avatar for wildplace
0
109
Member Avatar for dumb.king12

write a program that accept a txtfile and compress it by removing adjacent duplicate characters. for example if the txtfile contains the line: DID THE BUNNY GET THE MISSISSIPI MAPS FROM BBB then the corresponding output must be: DID THE BUNNY GET THE MISSISSIPI MAPS FROM B..

Member Avatar for Ancient Dragon
-1
78

The End.