49,761 Topics

Member Avatar for
Member Avatar for ghalibsultan

Problem Statement: You are required to define a string class name string. The data members of the class are the character array and size of the character array. There should be two constructors one is default and other should be overloaded constructor. Display() is the method which display the string. …

Member Avatar for dusktreader
-3
99
Member Avatar for clutchkiller

This is an assignment for my c++ class im taking. [code] #include <iostream> #include <fstream> using namespace std; const int NAMESIZE = 50, DATE = 25; struct inven { char name[NAMESIZE]; int qnty; double wholeCost; double retailCost; char date[DATE]; }; void displayMenu(); void addRecord(fstream &); void displayRecord(fstream &); void modifyRecord(fstream …

Member Avatar for clutchkiller
0
185
Member Avatar for VilePlecenta

While finishing up my app, I included into the project the code for loading and injecting my dll into running processes. Once compiling I received these errors [CODE]error C2039: 'getchar' : is not a member of '`global namespace'' error C2873: 'getchar' : symbol cannot be used in a using-declaration error …

Member Avatar for VilePlecenta
0
135
Member Avatar for Skeen

Okay, I'm making a shooter game, and all my weapons are differnt userdefined objects; ie. the flamethrower works differently then the gun, however, I'm calling some functions in my "main", an example of this would be; [CODE] /* <Init> */ MachineGunClass *CurrentWeapon; MachineGunClass *MachineGun; MachineGun = new MachineGunClass(); CurrentWeapon = …

Member Avatar for mrnutty
0
224
Member Avatar for liljazz2007

ANY HELP YOU CAN PROVIDE WILL BE GREAT. Here is the code Im trying to convert. This is my 1st time hearing about SRC Code and my teacher isnt being a big help. Please help in any way you can. Here is the code: int a = -5; int b …

Member Avatar for Nick Evan
0
240
Member Avatar for soapyillusion

Hey all I have another riveting problem from my genius professor T_T. I have to make a program using functions, reference Parameters and full string words. Now if it were just a single letter at a time this would be easy. But it wants us to let the user enter …

Member Avatar for soapyillusion
0
252
Member Avatar for ghalibsultan

Problem Statement: You are required to define a string class name string. The data members of the class are the character array and size of the character array. There should be two constructors one is default and other should be overloaded constructor. Display() is the method which display the string. …

Member Avatar for WaltP
-1
80
Member Avatar for wolfhunter777

This assignment is about a space ship fighting game. It's turn-based between the player and the computer. I'm suppose to create this function that will transfer the ship upon death to the one who destroyed the ship. For example, lets say the player manages to destroy one of the enemy's …

Member Avatar for WaltP
1
106
Member Avatar for liljazz2007

Here is the code Im trying to convert. This is my 1st time hearing about SRC Code and my teacher isnt being a big help. Please help in any way you can. Here is the code: int a = -5; int b = 3; int c; if (a == b) …

0
59
Member Avatar for rsaska

Hello, I am creating code that seemed fine, except when I entered a single character, or strings instead of numbers, the console continually prompts for user input and it is difficult to terminate the console. Below is the code [CODE] printf("\nHow many computers do you want to update?\n"); scanf("%d", &numComputersToUpdate); …

Member Avatar for rsaska
0
77
Member Avatar for c++student01

I am in a c++ class and I am doing a program which requires me to read in a text file and do change it. I need to know if something is in " " or ' ' to do this program. I can get the " " by doing …

Member Avatar for potatosoftware
0
192
Member Avatar for mingas

Hi forum! My name is Eduardo and I´m from Portugal. I´m a newbie to C++ and I hope to learn a lot with you I´m facing a doubt that I couldn´t solve yet. (I will also post this thread at c++ area, hope you don´t mind ) My doubt lies …

Member Avatar for Ancient Dragon
0
210
Member Avatar for PDB1982

Can anyone help me with this one? I have the following code and produces an output, but the Probability stays at 1 regardless of how many students I input....Any ideas? [code] #include <iostream> #include <fstream> #include <cmath> using namespace std; void main() { int numStudents, DayOfBirth, cnt; double Probability, Power; …

Member Avatar for PDB1982
0
50
Member Avatar for mybluehair

I am just being introduced into the allegro game library, and I'm making a simple program. My problem is confusing me horribly. I'm using the textout_ex code, but what I want to do is display 2 pieces of info in one textout function. Like: textout_ex(screen, font, "hello" [B][U]AND[/U][/B] MyVariable , …

Member Avatar for WaltP
0
134
Member Avatar for cool_aj

Please help me correcting my program.The question requires me to offer a repeating MENU with 3 choices. 1. Displays all students 2. choose one by entering the ID and also making changes to it. 3.exit. My error so far is "cannot convert to `int*' for argument `1' to `in".I don't …

Member Avatar for jonsca
0
1K
Member Avatar for truthuntold

I am running into problem on getting this program done. Its suppose to quiz you on your 2 powers ie(2^2 = 4, 2^22 = 2m, 2^46 = 32t) I've programmed in python for a couple years but a lot of the tricks python lets us have C++ doesn't or I …

Member Avatar for WaltP
0
97
Member Avatar for emitris
Member Avatar for WaltP
-3
208
Member Avatar for Nick Evan

[B]Background[/B] I was looking for a simple control in wxWidgets which I could use to plot out [i]some value[/i] against time, but I found that apparently I was the only one that needed that kind of graph. (so I don't know why I'm posting it... but anyway). I decided to …

Member Avatar for callmegood
0
911
Member Avatar for mybluehair

I'm just now learning Allegro, and all the tutorials I have looked at have used a function called textout_ex to print things out to the screen. [B]The problem is -[/B] textout_ex is really starting to p*ss me off horribly because of how specific you must be in the info you …

Member Avatar for mrnutty
0
108
Member Avatar for Cyberhacker

Hello my name is roman I have this project to do that involves the following: I need to take a text document full of numbers and output the lowest of those numbers and the highest of those numbers but they first have to be put into an array then outputted... …

Member Avatar for WaltP
0
124
Member Avatar for jateshs1007

Create a computer application to maintain the product inventory of a T-shirt distributor using a database. Each record will contain a T-shirt name, a price, and the quantity on hand. The inventory can manage a maximum of 30 different shirts. The database you implement should allow a user to add …

Member Avatar for WaltP
-1
244
Member Avatar for suncica2222

why do people define main() as int [B]and not void[/B]? and then write return 0; or return 1; or return -1; or return EXIT_SUCCESS; what is the point of this?

Member Avatar for Narue
0
82
Member Avatar for wwsoft

I'm making a framework for what will eventually be a game. All objects in game are derived from game_object. I store everything in vectors; The _objects_ vector contains pointers to objects. The problem is when I call update the default update() function from game object is ran instead of the …

Member Avatar for dusktreader
0
99
Member Avatar for gepo

[CODE]class monomial { public: monomial(){}; monomial(string vars); // Assignment operator [COLOR="Red"]void operator= (monomial & p);[/COLOR] monomial operator* ( monomial &p); monomial operator/ (monomial &p); bool operator== ( monomial &p) ; bool operator> ( monomial &p) ; bool operator< ( monomial &p) ; void print(); public: list<unsigned int> var;//variables separated by …

Member Avatar for gepo
0
106
Member Avatar for totalwar235

i am having a few errors compiling a code in visual C++ with my jumble word code, can anyone help? [CODE]//word jumble #include <iostream> #include <string.h> #include <cstdlib> #include <ctime> using namspace std; int main() { enum fields{WORD, HINT, NUM_FIELDS}; const int NUM_WORDS = 5; const string WORDS[NUM_WORDS][NUM_FIELDS] = { …

Member Avatar for totalwar235
0
315
Member Avatar for xcarbonx

hello, i just had a very simple question about float, so i am not going to post the full coding, only what matters in this instance. my output of program shows the computed number as 4, instead of 4.00, even though it is declared as float Here is the example: …

Member Avatar for xcarbonx
0
94
Member Avatar for jdpjtp910

I have a program that is menu driven by functions. The program gathers inventory data from the user and then the user can add, change, display (by record #), or display all records. The code works great, BUT when I add records and go to edit them, it changes the …

Member Avatar for mitrmkar
0
122
Member Avatar for uniquereason

I am trying to create a program that compares two files that contain letters from A to E. Both files have 20 of them. Now im just stuck i feel that i could use if statements but i don't know how to go along with it. Any help will be …

Member Avatar for Nick Evan
0
180
Member Avatar for AlmaREY

[I]<<split>>[/I] so you did get your program to work then??? i am running into the same problem. i get this error \prob 3.cpp(15) : error C2447: '{' : missing function header (old-style formal list?) but my programs heading looks just like all i have seen and i cant find anything …

Member Avatar for Ancient Dragon
0
272
Member Avatar for skorm909

here is my script: [CODE]#include <iostream> #include <cmath> int main() { using namespace std; int who; cout << "how are you today? good, bad, or eh?" << endl; cin >> who; if (who == "good") { cout << "ahh thats pretty cool i guess..." << endl; } if (who == …

Member Avatar for skorm909
0
354

The End.