- Strength to Increase Rep
- +6
- Strength to Decrease Rep
- -1
- Upvotes Received
- 4
- Posts with Upvotes
- 4
- Upvoting Members
- 3
- Downvotes Received
- 0
- Posts with Downvotes
- 0
- Downvoting Members
- 0
Re: I usually use Eclipse, but switch over to Netbeans when I do any sort of GUI. | |
Re: What protocol do you want to simulate? At what layer? You should be able to code a simulation up depending on which protocol you want to simulate. You might also want to do a search into network simulation tools. I haven't used any, but I've heard of omnet and ns-2 … | |
Re: Just tested it with the changes mentioned, and it works for me too. | |
Re: Here are another 2 options: 1) Make a copy of the array, and do only a partial selection sort. Use the variation of selection sort that puts the largest element at the end. Since you only want the top n elements, only run the outer loop of selection sort n … | |
Re: If your SoapPair class has any member variables, all of them have to be of a type that is serializable. | |
Re: Your instructor's feedback is extremely straight forward... Also he did miss some things: - The US dollar to English pound conversion in your code is incorrect, take a closer look at the conversion list to see why.. - Your output module only outputs the currency type... are you sure that's … | |
Re: Not sure where to start on this one... You haven't really followed the instructions. The instructions state that EACH student data record should be dynamically allocated. Instead your student list creates a static sized array of 100 records. What you need to do is make a StudentRecord class which stores … | |
Re: 1. recv() will NOT necessarily receive all the bytes sent in one call. You will have to loop it. Since recv() returns the number of bytes received, what you can do is have the sender always put an integer at the start of each message specifying the length of the … | |
Re: The panel class needs a reference to your frame class. Assuming your frame class creates the panels, the frame should send a reference to itself ([I]this[/I]) as an argument to the panel constructor. You will need to change the panel constructor to accept this argument and store it. Now when … | |
Re: I would argue that the majority of code people write is iterative rather than recursive. Because recursion has more overhead in terms of memory and speed, iterative approaches are generally preferred unless the recursive version is much simpler to understand and implement. I'd say the biggest downside to recursion is … | |
Re: Instead of: int board[4][4]; Replace with: int** board; Now we can dynamically allocate space for the 2D board array. In set_board(), we need to do the dynamic allocation like so: [code] // First allocate for the first dimension board = new int*[height]; // Now allocate for the second dimension for( … | |
Re: The lowercase part you have actually won't work for all cases... What I would do is just have a boolean variable for each condition, and each check will set the appropriate variable to true or false. Then at the end just 'and' them all together to get whether it is … | |
Re: Not really sure what you are asking... but if you're asking what sum = sum + 5; does, then the answer is that it increases the value stored in sum by 5. | |
Re: Also try to keep your indentation a standard width - usually 3 or 4 spaces is good. As for the non-standard includes as mentioned above, I'm guessing you are using something old like borland or turbo C... I would recommend you start using either VC++ or Code::Blocks. | |
Re: The other option is to just sort both arrays which will make traversing the arrays and finding non-duplicates much easier. | |
Re: Well if the output is always zero, then either 5/9 is 0 or F-32 is 0. Try and write a small program that just prints the result of 5/9 and one that prints the results of F-32 after the user enters F. That might help you narrow down the problem. | |
Re: Have you learned about classes in your course yet? If so then you should be using them. If not, you should at least break your functions up into smaller, more manageable functions. Also you should learn how and when to use header files and multiple cpp files rather than having … | |
Re: You are getting mixed up about what should be in your main() and what should be in your class methods. As the problem specifies, input for a TMoney should be done in the inputdata() method, and output should be done in the outputdata() method. The main should only declare an … | |
Re: Hmm not exactly sure what that would be happening, but there are still a couple things you need to change. At the top you should declare gRow and gCol as const int - I'm not sure how this even compiles with no type given. Also you should make a loop … | |
Re: Since you are adding nodes to the head (start) of the list, the last node you add will be in position 0. The output is correct for the example you gave. I'm assuming the list isn't supposed to be sorted - if so then you need to change your add … | |
Re: The Java API is your friend: [url]http://java.sun.com/javase/6/docs/api/[/url] Look up FileWriter, look at the constructor and the write methods. | |
Re: You will need nested loops. The inner loop will print one line of numbers, while the outer loop controls how the pattern changes for the inner loop. If you're still stuck, try solving the problem in steps. First create a loop that will print just one line of the pattern. … | |
Re: To add two times as you have listed, first add the seconds together. If the seconds > 59 you will have to use modulus (%) to find the remainder of the seconds. You can then use this information to figure out what the actual seconds are and that a minute … | |
Re: You're off to a good start, here are some little tips/observations that might help you: 1/ Your header file should contain the structure definition as well as the function prototypes for functions related to that structure. So basically you should move the function prototypes into your header. Remove the last … | |
Re: Just 71C15 alone is over 914 trillion combinations. A normal computer can do about 1 billion/sec. This means it will take about 10 days to compute just 71C15. You might be able to do 71C7 or 71C8 in a reasonable amount of time. | |
Re: Generally when you are doing recursion on any kind of collection of items (lists, arrays, even strings) you want to solve the problem for the first element of the collection, then recurse on the remaining part of the collection. For this example you can look at the first element of … | |
Re: I think you're going to need to give more information about what you need to do. | |
Re: It depends on the platform. Since a pointer is an address, it must be big enough to store the largest address. I'm fairly sure that in windows addresses are 32bits (4 bytes). In linux/unix it may be different. | |
Re: You are right that the array name is the address of the first element of that array. This works exactly the same for arrays of char as well. In C, there is no "string" type, so we are forced to use arrays of char. There is one special difference between … |