49,757 Topics

Member Avatar for
Member Avatar for OnTheRadio

My assignment is: Your goal is to write a program that sorts a list of 4-letter words using different sorting algorithms and report the fastest method. First your program should prompt the user to indicate the number of words to generate. Your program should then generate a list of random …

Member Avatar for OnTheRadio
0
113
Member Avatar for dnalor

[code=cplusplus]#include <iostream> #include <conio.h> #include <iomanip> #include <fstream> using namespace std; const int numStudents = 5, numQuiz = 10, numAssign = 10, numFinal = 1; const int totalGrades = 21; void computeStudAver(const int grade[][numQuiz], double stAve[]); void computeQuizAver(const int grade[][numQuiz], double quizAve[]); void printall(const int grade[][numQuiz]); int menu(); int main(); …

Member Avatar for brillantes
0
84
Member Avatar for TheWolverine

Hi all, I was wondering if there is any standard way in C++ (perhaps in the standard library) of handling mathematical equations that are composed of +/- signs. For instance, if you are given the equations: [quote] y = +/- sqrt(x) z = +/- y [/quote] Is there an efficient …

Member Avatar for TheWolverine
0
148
Member Avatar for jdpjtp910

I have a code and its almost done. Its for a school project and I am stuck. I have DivSales and a CorporateSales.cpp. The programs should ask the user for 6 divisions quarterly sales. Display the results into a table and give a total of sales. My total feature is …

Member Avatar for Murtan
0
1K
Member Avatar for daviddoria

This code: [code] #include <iostream> class Parent { int name; class Child { int school; void test() { std::cout << this->name; } }; }; int main(int argc, char *argv[]) { Parent MyParent; return 0; } [/code] Generates this error: [code] error: 'class Parent::Child' has no member named 'name' [/code] Is …

Member Avatar for HealBrains
0
172
Member Avatar for rockstar8577

For some reason i cant output to a file unless it was already created. Here's my code. [code] fstream myfile; myfile.open (filename.c_str(), ios_base::in); if (!myfile) { myfile.close(); myfile.open (filename.c_str(), ios::out); avatar.name = name; avatar.init(); myfile << "Name = " << avatar.name << endl; myfile << "hp = " << avatar.hp …

Member Avatar for rockstar8577
0
112
Member Avatar for AJW

hello all, I'm taking a C++ class at my local community college. A project that was assigned was to make a menu program. I am about 90% done (I think), when I ran into this issue: when making a selection, the program doesn't know how to handle decimal numbers. The …

Member Avatar for AJW
0
108
Member Avatar for daviddoria

I have some code that uses _finite (I think from float.h) that my linker complains is not declared. I think this might be a "windows only" function. Is there an equivalent function that I can call that will work cross platform? Thanks, Dave

Member Avatar for daviddoria
0
210
Member Avatar for jigglymig1

i have to write a program that will read in a txt file that also has periods, exclamations, question marks and <CR>(returns). and do some other stuff. right now i am having trouble with comparing the words..... this is at the very bottom of my code [CODE]#include <iostream> #include <fstream> …

Member Avatar for mrnutty
0
83
Member Avatar for tnclark8012

I've been tasked with implementing either the min-max function or alpha-beta pruning to code AI for the game Gumoku (connect 5, vertical, horizontal, or diagonal). In both algorithms an evaluation function is called to analyze the board of play. Is there any "easy" way to do this? My initial plan …

Member Avatar for MyrtleTurtle
0
165
Member Avatar for D4n1sD

Hello, I am wondering how its possible, to make a server that you can connect to it, through IP and Port and than send data to it, For example I am trying to make a simple multiplayer game. But I am really amateur on connections etc. So please help me …

Member Avatar for D4n1sD
0
85
Member Avatar for BeyondTheEye

For an electronics project, I have to access the TxD, RTS and CTS pins of a serial port individually. Well, any 3 pins could be used, but those 3 are preferred. All I've been able to find on the microsoft website are functions to access the serial port as a …

Member Avatar for BeyondTheEye
0
250
Member Avatar for dieter22

Hi there! I'm new to c++ and I'm having problems with ifstream. I assume that my question is pretty stupid but here you go: I've got something like: [code=c] ifstream infile(inname); [/code] Furthermore I do have an array - let's call it Array - which contains several filenames I want …

Member Avatar for TerishD
0
378
Member Avatar for ndayala

[CODE]#include <iostream> #include <list> using namespace std; template <typename T> class superlist : public list<T> { public: // squish() is a mutator that "squish" together adjacent duplicate // elements in a list. // // Example #1: // [3, 3, 4, 3, 3, 3, 2, 8, 8] // becomes... // [3, …

Member Avatar for ndayala
0
108
Member Avatar for squarey

Hi Guys I want to build an application which can be used to empty the content of bad (remapped) sectors. At the moment I really dont know where to start, so I am hoping someone can give me a push in the right direction. It would also be nice if …

Member Avatar for Salem
0
194
Member Avatar for karolik

So I made a template...I tried declaring a string linkedlist like so... [CODE]LinkedList<string> str; [/CODE] Then i called the function insertLast to insert a string called hello..like so... [CODE]str.insertLast("hello")[/CODE] Then it gives me null pointer error...I cannot see how there can be a null pointer...help would be appreciated..Here is the …

Member Avatar for mattbond
0
179
Member Avatar for soapyillusion

Hi all, sorry to once agian come begging for help, but the professor wants us this time to have the program have a function read the word then for each letter have another function confrim if the letter is a vowel or not, then have the first function remove the …

Member Avatar for soapyillusion
0
357
Member Avatar for liveshell

I have following peace of code, when i check it with valgrind it gives me "537 bytes in 19 blocks are possibly lost in loss record 12 of 12" Following is the code: CManager.h [CODE]class CManager enum RespType_en { eInvalidRes = 0, eAuthRes, eActivateRes, eSetStateRes } map<RespType_en, string> m_mRespTags; [/code] …

Member Avatar for Salem
0
743
Member Avatar for Xhoana

Hi everyone! I'm new to C++ and i was told Dev CPP is a good compiler. I installed it and anytime i try to open it comes out this message: There doesn't seem to be GNU Make file in PATH or in Dev C++'s Bin path. Please make sure that …

Member Avatar for Salem
0
118
Member Avatar for react05

I need some help with postfix expression please. I've only been able to find examples about changing from infix to postfix. With the code provided below, I want it to the following: 1. if the token is an operator (it is a +, -, *, or /) a. two items …

Member Avatar for react05
0
198
Member Avatar for pamelaanne05

Here's my code for the upright triangle. Now I'm hard up on doing the code for inverted triangle, I'm working on it right now, but a little help would be great. [CODE]#include <iostream.h> #include <conio.h> void main() { int len,ht,ch,cho,sz,col=20,ctr=1; cout<<"\nTRIANGLE"; cout<<"\nEnter Size: "; cin>>sz; if (sz<5||sz>20) cout<<"Size must be …

Member Avatar for pamelaanne05
0
88
Member Avatar for daviddoria

I am trying to compile some old code a colleague gave me. I have MyClass.h [code] class MyClass { public: static int UseIndex; .... }; #include "MyClass.inl" [/code] MyClass.inl [code] ... int TreeNodeData::UseIndex=1; ... [/code] I am getting: [code] multiple definition of `MyClass::UseIndex' first defined here [/code] I got several …

Member Avatar for daviddoria
0
217
Member Avatar for desperado85

I have a CString : CString data; data.Format = ("!64.8 Px.1= 1200"); I would like to copy the number 1200 from data to another CString data2. Anyone can help? Thanks in advance

Member Avatar for mitrmkar
0
95
Member Avatar for karolik

So i have Class Parser and in this class is constructor [CODE]Parser(string s){ // constructor tokens = s.c_str(); // convert to a C string opStack.push(END); // initialize opStack }[/CODE] tokens was defined as const char *tokens in private ; That is in the parser.h file However when i try to …

Member Avatar for mitrmkar
0
108
Member Avatar for Abdel_eid

i need a c++ compiler with a graphical user interface which can easily be used and that contain many option like for example microsoft visual ,simply i can write the code on a gedit and compile it by using : g++ "file name" -o test ./test but it is so …

Member Avatar for Abdel_eid
0
145
Member Avatar for Luks

In have been coding a small program to calculate the % body fat. But is giving the error C2064 as above. Any help will be appreciated guys! The error is here; [CODE] /Compute Body fat percentage for male if (gender == "Male"){ BFat = 495/(1.0324-.19077(log(abdomen-neck))+.15456(log(height)))-450; // THE ERROR IS HERE …

Member Avatar for Luks
-2
221
Member Avatar for tnclark8012

Hey everyone, I'm having an issue with the simplest vector functions. I'm trying to add a Piece object to a vector, but it's data members are being changed when I do... am I missing something? [CODE] /* Piece.h */ #ifndef _PIECE_H #define _PIECE_H class Piece { public: Piece(); Piece(int r, …

Member Avatar for tnclark8012
0
170
Member Avatar for qk00002

I only have one more small question is I have made a textbox in C++ CLR, how can I load text from a text file? thank you.

Member Avatar for kvprajapati
0
193
Member Avatar for ravenrider

Hello I had the seg fault last night, after making some changes, I don't have it anymore, the program compiles but it doesn't do anything ! " the program should read in data from the file in this following form : 2 Dell inspiron 299 Hp pavilion 499 " simply …

Member Avatar for Murtan
0
145
Member Avatar for BobC22

Hi, I am going to be attending university next year on a coding course, I am currently working through an exercise in the Deitel book How To Program and I have encountered some errors in my program. Any help would be much appreciated. Bob Here is my code cube.h [CODE]#include …

Member Avatar for mrnutty
0
165

The End.