581 Posted Topics
Re: You Do Realise that there is no looping mechanism taking in moves right. I mean, this program calls the function "move" once. and after its done sucessfully.. Its job is done. You will have to think of a way that it continues calling move() until the user wishes to quit. | |
Re: Do You Have any idea on how a vector works? And discovered a cross post . [url]http://www.dreamincode.net/forums/topic/168510-towers-of-hanoi/[/url] | |
Re: Post down the code which you have already worked on .. And then ask for specific questions. You get lots of help on this forum in that manner :) | |
Re: Design your own game... or why dont you design a replica of some game .. and rather make it more interesting (if the original was not interesting . ) ... | |
Re: [code] Vehicle milesPerGallon(double mpg); cout << "Please enter the number of wheels for the vehicle:" << endl; cin >> wheelss; Vehicle wheels(int wheelss); [/code] You are declaring function prototypes here. where-as i think, you need to call the functions there. Guess you should probably check that out! | |
Re: [QUOTE=mattjbond;1184072]But you want this to have FIFO behaviour? Why not create your own queue class, based on a deque for instance, which has a specialized push which will not allow duplicates. Simply peek at the last value pushed and if it is equal to the new one don't add then … | |
Re: Prototype and Function definition parameters donot match. Change the function definitions second argument to a pass by value and not pass by reference. And i think it will have no problem compiling And Yeah, the next time you post code.. please make sure that you use the code tags properly. … | |
Re: I think this records all instances of people asking questions and also answering them. Then it is actually making a database. By that we actually end up talking to the creations of Other People. For example. I have went on posing the same question that it has asked in some … | |
Re: Its better if you have an array of 10 ints and then put down a for loop to check whether its positive or negative and add them up. If you have variables like this., IT WILL TAKE A LONG TIME TO WRITE IF LOOPS. AND THEN ADD. to check if … | |
Re: Exactly i'm a student in india and i rather have to suffer almost daily learning C++ on TURBO C.. with no String implementations , NO Vectors and something that allows "void main()" i really hate it.. | |
Re: or u can change to.. [code]alfadia.push_back(*alfadi);[/code] i think..... | |
Re: Even if you get the code to work... The first stack will be empty while the second stack will have the letters in reversed order. So this code would always return False!! | |
Re: [code] if(flag[COLOR="Red"]=[/COLOR]1) { cout<<i<<endl; } [/code] You seem to be assigning 1 to flag but not checking. [code] if(flag[COLOR="Green"]==[/COLOR]1) { cout<<i<<endl; } [/code] Secondly, Because you only need to find one prime number. [icode]return 0;[/icode] after the cout statement, would stop it. This is the syntactical part. I would not … | |
Re: Seems like you need to store all the values. But your code will only store the last value. that has been given like input. If you need to store all the values that have been given. You should consider using Arrays. ![]() | |
Re: you will need to set up the variable values for numerator and the denominator using 2 different for loops and then compute numerator/denominator.. after which you send it up. | |
Hey Everyone, I have written this Matrix Multiplication program. But The Program seems to crash when during the filling of the first matrix, exactly after the completion of the first row. Here is my implementation [code] #include <iostream> using namespace std; void generate (int ** ,int ,int); void fill (int … | |
Re: On Line 35 [code] fsFile.getline(chrLine,1024); [/code] This will cause you to skip every alternate line of information. Second error, [code] char *arrLine[20]; [/code] the array is of 20 elements so they would be placed "0,1......18,19". So The code in the for loop would cause an out-of-bound error. [quote=OP] Problemo starts … | |
Re: [url]http://www.daniweb.com/forums/announcement8-2.html[/url] The answer to all your so called queries!! | |
Re: The Prime testing method is absolutely mis-interpreted. [url]http://www.daniweb.com/forums/thread233963.html[/url] Here is a recent prime number test code. Try to change it such that it matches your requirements. Though, i would prefer you try to understand what exactly is going on. | |
Re: Well firstly you will need a database or a particular condition to determine the age of the person with the ID card number. If this is a project for you ..... read through the material to get the basic condition. And then you can interpret it in the code :) … | |
Re: apart from what A.D said, to get a little technical, you may want to try the peek() function. Check if that character is an alphabet or a number. if its a number . take in the number with the >> operator using an integer . and to get rid of … | |
Re: Or another thing you can do is to call the grade function from Average (). | |
Re: Post down your current code. This forum has a rule that we cannot give homework help until you show your effort. :) | |
Re: This is perfectly right !! Nice, work figuring out the suggestion of FirstPerson . | |
Re: Well this program is not as complex as it seems to be. [code]for(i=1; i<=100; i++)[/code] The first for loop runs from 0 to 100, and runs a test for checking whether its prime or not. Then in the second for loop. [code]for(j=2; j<=i/2; j++)[/code] We now start the test at … | |
Re: Well, what dkalita means is that.... no value is assigned to the variables. givenFirst and givenLast. Apart from that there are many other mistakes in your program. Firstly, the declaration of the variables givenFirst is wrong because [icode]string [/icode] should be in the place of [icode]String [/icode] notice the capital … | |
Re: I wonder if it is compulsary to use new to allocate variable space. Since it is only one. Why dont you just declare a variable. That way you will not need to worry about deleting. as the Destructor will be called at the end of method. Apart from that, unless … | |
Re: Do you know how to use arrays? If you are comfortable with arrays, try using them to replace the different mark variables. Btw, this program doesn't check if the other variables apart from f, have been initialised to a value greater than 100 or lesser 0. Examine that you only … | |
Re: I really wonder if that's possible.. What you are trying to do is to make an executable without actually compiling the C++ syntax. Without the compiler, I think that the C++ syntax would be juz lines of data and nothing else. My Suggestion would be to install a compiler on … | |
Re: Well is it that you want the value of the variable to be changed at run-time or during compilation. | |
Re: Add the 10 totals value to derieve a FULL SALES value, That Sales divided by 10 would give you the Average. What you can do is store the totals in the array, then compute the Average. And then determine... Btw, Please make sure if your code runs properly. It must … | |
Re: [code] cout<<strupr(s[0]); [/code] This Does Not Work . Because strupr() takes a char* as an argument. So the argument should be a sting having a null character ie: '\0' at the end. But you give a character as its argument. This is the error. To solve this problem, You can … | |
Re: [QUOTE=Towely;1021389]Thanks for the reply. Is there any way that I can clip the triangle without creating a new For statement? Could I put the break statement into one of the loops I already have? My assignment specifies that I can't use a For loop specifically for clippin the triangle... it … | |
Re: Firstly, I would like to point out to you that your code is actually assigning values but not comparing them. [[CODE]while(g[0] = 0 || g[0] = 1 || g[0] = 2 || g[0] = 3 || g[0] = 4 || g[0] = 5 || g[0] = 6 || g[0] = … | |
Re: Remove the declaration of the variable [icode] int i=0; [/icode] from line 14 and place it in between 33-34 or 34-35. The problem is that the scope of the variable which retains the value of 11 after the first for loop and therefore causing the program to crash., The other … | |
Re: Ok, I would currently say that your solution is INCOMPLETE, But it doesn't suck!! :) Though I will not completely give you the solution, here are a few tips on getting to the right path. Firstly , Try Implementing the solution considering that the exit will be at the entry … | |
Re: Well the thing is that, You get to know if a certain number is prime .. After you have checked it with all the numbers. But here .. You are checking it with each number and then printing them up. So its like you are determining if a number is … | |
Re: firstly, logical and in C++ is represented by '&&' so you will need to have. [code] while(p1 != NULL and p2 != NULL)[/code] Changed to [code] while(p1 != NULL && p2 != NULL)[/code] The same applies to the if loop below as well. Secondly, Your Logical error is that you … | |
Re: [URL="http://www.daniweb.com/forums/announcement8-2.html"]Have fun implementing it !! [/URL] WE DONT GIVE HOMEWORK HELP IF YOU DONT PUT IN EFFORT. Write some code and then get back to the site to clear doubts or errors (if any) | |
Re: [code]for(int i = first; i->link != NULL; i = i->link)[/code] Check Line 4 in the code in your post. it consists the above code.You have declared variable [icode] i [/icode] to be of type [icode] int [/icode] then you use the [icode] -> [/icode] operator . THAT would be the … | |
Re: I would say that this is supposed to be a C question and even that it is poorly written. Whats your question ? | |
Re: Well in your question. You said that you need to use arrays. But You are not using any in your program. The best approach would be to analyse the question and think how you can use a index to get the required result and also where you will need arrays. … | |
Re: A google search before posting always helps. Anyways check this code out. [url]http://forums.devx.com/showthread.php?t=154478[/url] | |
Re: [url]http://www.eternallyconfuzzled.com/tuts/languages/jsw_tut_pointers.aspx[/url] This link would also help you understand the pottential of Pointers. | |
Re: Firstly you are looking at different operations. 1) Maintain A Database, That's pretty much done, when you have a excel spreadsheet which you can later convert into CSV (Comma separated Value ) sheet. 2) Now you need to compare two files and remove particular entry's (This file editing is done … | |
Re: >>for tasks like automatically signing in into my gmail account,sending a particular email to all my frnds, Well,You could basically use an Email client to sign into gmail check for new mails and then sending an email to all of your friends. Why do you need to re-invent the wheel … | |
Re: Well Dynamic 2D arrays take a little more complexity.This is mainly because when you declare something like this [code] int *p; p= new int [2][2]; [/code] What you are trying to do is assigning a pointer array to a pointer itself. THe [icode]new int [2][2] [/icode] converts itself into a … | |
Re: Well take the month as input from the user, and then the day of the month, Find the corresponding [ month-1] and add the days of the month value to it, to get the required result, As far as the constructor, you will now need an extra member to save … | |
Re: [url]http://vtkblog.blogspot.com/2007/04/install-build-vtk-from-source-in-visual.html[/url] Download the Pdf document from that site, Its quite comprehensive and I think is what you require :) | |
Re: A suggestion would be to add another member function like [code] template <class T> T basicArray<T>::method() { initArray(); printArray(); sortArray(); printArray(); }[/code] So then your main function would be [code] int main() { basicArray<int> dataArray; dataArray.method(); std::cin.get(); } [/code] This is useful, only if you are thinking of performing the … |
The End.