Forum: C++ Jan 20th, 2009 |
| Replies: 6 Views: 544 Just tested it with the changes mentioned, and it works for me too. |
Forum: C++ Dec 9th, 2008 |
| Replies: 1 Views: 316 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:
// First... |
Forum: Java Dec 9th, 2008 |
| Replies: 4 Views: 430 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... |
Forum: C++ Dec 9th, 2008 |
| Replies: 2 Views: 344 The other option is to just sort both arrays which will make traversing the arrays and finding non-duplicates much easier. |
Forum: C++ Dec 8th, 2008 |
| Replies: 8 Views: 575 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... |
Forum: C++ Dec 8th, 2008 |
| Replies: 7 Views: 508 When adding the node at the end (as you are now doing), you should have the new node point to NULL instead of head. The reason you get it infinitely repeating is because when your end node points to... |
Forum: C++ Dec 8th, 2008 |
| Replies: 7 Views: 508 What exactly are the requirements? Are you supposed to be adding new nodes to the beginning of the list or the end of the list? Are you sure you are not supposed to get the result you got?
In the... |
Forum: C++ Dec 8th, 2008 |
| Replies: 7 Views: 508 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... |
Forum: C++ Dec 5th, 2008 |
| Replies: 3 Views: 390 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... |
Forum: Java Dec 3rd, 2008 |
| Replies: 4 Views: 514 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... |
Forum: Java Nov 30th, 2008 |
| Replies: 4 Views: 492 You shouldn't ever be returning the operators though, only the result of operations or the number value in the node.
In the first branch, after you apply the operator to the two children, you... |
Forum: C Nov 28th, 2008 |
| Replies: 2 Views: 427 You have allocated space for all of the studentInfo pointers here (except the last one, you should not be subtracting 1):
struct studentInfo *students[numOfStudents-1];
But, you have not... |
Forum: C++ Sep 1st, 2008 |
| Replies: 4 Views: 579 It should be readfile >> sample; since you are getting input, not outputting. |
Forum: C++ Aug 24th, 2008 |
| Replies: 4 Views: 1,248 I have not used them, but I believe the boost library has threads and you can try pthreads as well. |
Forum: C++ Aug 24th, 2008 |
| Replies: 10 Views: 1,350 I can guarantee you the problem is not winsock, it is something you are doing.
Can you post a little code where you are having the problem, tell us what you are trying to send and what you are... |
Forum: C++ Aug 23rd, 2008 |
| Replies: 2 Views: 478 Vertices are the points or corners of a polygon. So a square is a polygon with 4 vertices, a triangle is a polygon with 3 vertices, etc. |
Forum: C++ Aug 20th, 2008 |
| Replies: 10 Views: 1,084 To be a bit clearer, you can use the stringstream class like so:
#include <iostream>
#include <sstream>
using namespace std;
int main() {
stringstream ss; // our stringstream object
... |
Forum: C++ Aug 14th, 2008 |
| Replies: 3 Views: 497 The first error means that the function ingresar_datos has never been declared - if you look through the code, there is indeed no function with that name.
The rest of the errors are because the... |