49,766 Topics
![]() | |
Im trying to solve ACM - 10082 [URL="http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=31&page=show_problem&problem=1023"]http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=31&page=show_problem&problem=1023[/URL] Judge is responding wrong answer...but, i have no idea why. Any suggestion? [CODE] #include<iostream> #include<string> using namespace std; char change(char x); int main() { string str1; getline(cin, str1, '\n'); transform(str1.begin(), str1.end(), str1.begin(), change); cout << str1; return 0; } char change(char x) … | |
Hi Pros! I've started a project called grina ( code name) which is web browser program fro people to view web pages using C++ with Qt based on the QtWebKit module. The fact is that, i know a little about the web browser system, that it acts like a compliers … | |
i have a few questions.: 1)if i wanted to write a line of code needed to declare a 1-dimensional array named names that can hold 8 string values would this be correct?: char names[8]; 2)how would i write the code needed to assign strings to each element of the array … | |
[B]Microsoft Visual C++ 2008[/B] My Project contains one Form1 and one Unit (module) Test1.cpp. There is the button1 on the Form1 which calls the function: [CODE]Test1::Change_Button_Text();[/CODE] There is only one function in unit Test1.cpp [CODE]void Test1::Change_Button_Text() { // #1 Form1::button1->Text = "Hello forum!"; // isn't working :( // #2 Form1 … | |
I have problem with this code,I want to print names of the windows in .txt file and it compile with no errors but it snaps in runtime. this function int x = GetWindowText(hWnd,title, 256); for the second arg require char* and cant deal with WCHAR and if i cast title … | |
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] = { … |
The End.