49,761 Topics
| |
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. … | |
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 … | |
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 … | |
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 = … | |
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 … | |
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 … | |
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. … | |
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 … | |
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) … | |
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); … | |
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 … | |
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 … | |
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; … | |
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 , … | |
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 … | |
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 … | |
| |
[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 … | |
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 … | |
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... … | |
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 … | |
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? | |
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 … | |
[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 … | |
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] = { … | |
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: … | |
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 … | |
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 … | |
[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 … | |
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 == … |
The End.