48,986 Topics
| |
Here is my code. I have a warning that (127) : warning C4715: 'ComputeSum' : not all control paths return a value [code] #include <iostream> using namespace std; const int MAX = 10; // Function prototypes, i.e., declarations for the functions we have created void ReadInput (int A[], int number, … | |
Hi, I was reading something that said goto was bad. Why is it a bad practice to use it? | |
I want the following program to use lesser memory as much as possible. Any suggestions? [code] #include <iostream.h> #include <conio.h> void InputNum(void); void SearchNum(int); int numArray[10]; main() { int num; InputNum(); cout<<"\nEnter the number to be searched:"; cin>>num; SearchNum(num); getch(); } void InputNum(void) { for(short i=0;i<=9;i++) { cout<<"\nNumber "<<(i+1)<<":"; cin>>numArray[i]; … | |
I just want to know the logic of how to create bouncing ball application using MFC . | |
I use the google data api for .net,but when excute it ,it give me a message that "unable to connect to the remote server",so I want do it as the google data protocol to do it use c++. Everyone,who can give me an example to study or some hint? thanks! | |
[code]#include <iostream> #include <windows.h> using namespace std; void about(){ cout<<"Expence-List 14/10/2008:"<<endl <<"Brought to you by www.******.com"<<endl <<"Programmed by **********."<<endl; Sleep(4000); system("cls"); } int MenuOne(){ int MenuSelection=0; cout<<"What would you like to do?"<<endl <<"--------------------------------"<<endl <<"1. Create a new expence list."<<endl <<"2. Edit a previous expence list."<<endl <<"3. View a saved expence … | |
basically if i ask for an string i.e. i ask someone a question cout<< "is this correct yes or no?"; cin >> a; and then a number is input the program just goes crazy how do i solve this?? | |
Hey guys I'm having a strange problem with my program and I'm not sure how to solve the problem. I have a function which takes an array clears multiple white spaces to make a sentence so [code=CPLUSPLUS] "abc def ghi" //becomes "abc def ghi" [/code] and it returns the length … | |
[code] #include <iostream> using namespace std; int main() { int speed, time, distance; // Get the speed. cout << "What is the speed of the vehicle in mph?\n"; cout << "(Enter a value greater than 0): "; cin >> speed; // Validate the input. while (speed < 0) { cout … | |
Okay, I know what's wrong with my program but I don't know what to do to fix it. I have to take a program we previous made and make it a template class. Okay, sounds easy enough. I know all the writing it right cause it ran fine before, now … | |
Hi, I'm having trouble coming up with a function that scans a word, starting from bit StartingBit, until the first zero bit is found. The function is suppose to return the index of the found bit and if the bit at StartingBit is alrieady what sought, then startingbit is return. … | |
I need to write a program where it would ask the user to enter a positive even number,when entered if wrong then it would say value is illegal and will terminate the program. If it is even then program prints out the square of the number. I have just started … | |
Hey all - i am working on a implementation of a binary tree. I have all of my code and it is from an previous project for the most part. except a few changes ... i have to use a driver program for this that creates a tree, deletes the … | |
Hello I have this code bellow i need some help with. im trying to make a number game but i have a problem that i cant solve, the loop i made dosent update the grid like it's supposed to do. when you first start it you will se 2 grids … | |
Hi All, Here i am with another question . When i execute the code below the destructor in Stone is called twice . Why? In main [ICODE] set<Stone> stones = bag.letMeSeeStones(); [/ICODE] is coming from reference hence "stones" should not be treated like a local object. [CODE=C++] #include <iostream> #include … | |
its me again! (and yes im stuck on yet another problem ***) i have created a code where the user is asked to choose a geometry formula and can solve a problem using any of the choices that are shown. now this code uses the switch function, but for my … | |
Hi, I'm learning intro to c++. My question is, how do I input values that come from a different text file so that the program uses those values for calculations? Basically, it gives me a list of numbers and tells me what the numbers are for... and then I have … | |
I have to match up airlines for flights in c++, but for certain matchups, the value would be equal to x. I need help to do it. Here's the code I have so far: [code] #include <iostream> using namespace std; int main() { int nROWS = 4; int nCOLUMNS = … | |
Hi Guys, I have an assignment to do a gpa calculator using class construction and an array of grades. The assignment is to have a class called Student and have a user enter an ID and then enter however many grades they want and then have the program calculate the … | |
[COLOR="Red"]How can I get a compiler for C++ like Dev-Cpp to support chinese character and pinyin input? Like if I wanted to make a chinese program that would allow chinese input and output in the console window... Example:[/COLOR] [CODE]#include <iostream> using namespace std; int main() { wchar_t input; char loop; … | |
hi there im rabdab and i really need help simplifying this codes for my assignment | |
hi and hello.... I'm a class XII student of CBSE board.we have to do a project in C++ in CS for the board evaluation....so i've chosen 'Airline Reservation Forum'.....i'm posting it and i want to hear to all valuble suggestions to make my project better.. (pls do find the attachment.....) … | |
hello.... I'm working with a project.Project is ANALOG WATCH in turbo C++. My problem is that PIXELS are not displayed.I'm using outtextxy() function.as [B]outtextxy(250,300,"20")[/B]..now problem is that "20" is not display coorectly.. I'm using laptop dv pavillion 2401..with XP O.S. this is correctly working on PC.... | |
Hi, I'm having trouble coming up with a function that scans a word, starting from bit StartingBit, until the first zero bit is found. The function is suppose to return the index of the found bit and if the bit at StartingBit is alrieady what sought, then startingbit is return. … | |
Hi All , I am facing some error in destructor in my class. Below is the constructor and destructor. Constructor seems to work fine . While the class get destructed it give the following error *** glibc detected *** ./main: double free or corruption (fasttop): 0x08743cd0 *** ======= Backtrace: ========= … | |
Hello, i have wrote a program using the while loop but it crashes whenever i run it Basically, the goal of a program is to calculate the population of a town with constant 10% growth annually and then find how many years left. here is my code (any help will … | |
Hi I am outputting data to a spreadsheet and have looped through one set of values. Later on I want to put some more values in the next column, I can move across to the next column but don't know how to get back to the top. Is this possible … | |
Hi all! I need to pass a list, like this: [code] //xmlparser.h public ref class XMLParser { ref struct Node { System::String^ type; System::String^ name; System::String^ role; }; System::Collections::Generic::List<Node^>^ xmlList; }; //form1.h #include "XMLParser.h" public ref class Form1 : public System::Windows::Forms::Form { public: Form1() { xp = gcnew XMLParser("settings.xml"); net … | |
I have to convert this program that I wrote to use switch case statements to handle user input (+, -, /, *, X). Any ideas? [code]#include <iostream> #include <string> using namespace std; int main() { double total = 0, counter = 0; char sign, X = 0; double value; do … | |
i want to make a simple game with c++ but i really do not know how to do it:-/ ....can somebody help me to do that because i really want to know how to make a game by using c++...:?: |
The End.