- Strength to Increase Rep
- +7
- Strength to Decrease Rep
- -1
- Upvotes Received
- 52
- Posts with Upvotes
- 49
- Upvoting Members
- 42
- Downvotes Received
- 4
- Posts with Downvotes
- 4
- Downvoting Members
- 4
Typical software development nerd. Over-educated, perhaps. I'd rather be helping others with their programming difficulties than actually accomplishing anything of my own. Which is why I'm here. Your problems fascinate me, my own are boring. :)
- Interests
- Hiking, cycling, attending live music/theater productions, spending time with my son, staring at the…
- PC Specs
- Aging Shuttle form-factor box with Ubuntu installed, currently powered down. Two employer-provided laptops:…
Re: What is the question? And is this supposed to be C++ code, or Java? "P U Q" is normally called a "union", not a "sum". I'm not sure why you keep checking that elements of multiset are not zero in sum(), intersection() and difference(). Zero is a perfectly reasonable value, … | |
Re: [CODE] bool keep_running = true; while (keep_running) { // do program stuff // prompt whether to keep running // handle response } return 0; [/CODE] | |
Re: What happens if you input -6? It looks to me as though your program will tell me it's odd. Try thinking through your problem out loud. If you can tell yourself logically how it should get to the answer, you should be able to program it correctly. For starters: "If … | |
Re: Can you clarify "get no result"? Were you able to build the executable? If so, did you get any error messages when you ran it? If it doesn't print anything to the console (assuming you're running it in a console window), did it occur to you that it might be … | |
Re: Not to pry into your personal business, but why would you want to do this, besides to spam somebody else's site? If you've been tasked with data entry to pre-populate a website, it would make more sense to enter the data into the back-end of the website, rather than through … | |
Re: for ghosts, i'd start with the simplest thing first, and get that working. pseudocode: [CODE] next_ghost_pos = updateGhostPos(); while (next_ghost_pos == wall) { ghost_direction = rand() % 4; next_ghost_pos = updateGhostPos(); } ghost_pos = next_ghost_pos; [/CODE] This will have a ghost move in one direction until it hits a wall, … | |
Re: Since you are new, suquan629, I'll offer a couple of pointers (no pun intended): 1. You don't need to memset the array to 0 since you've allocated it to be exactly as long as you need 2. Since this is a learning exercise, don't use strcpy(), instead use a loop … | |
Re: I'm not going to go into the code you "found" that does some of what you want. The purpose of the assignment is to write your own, starting with an understanding of what you are trying to accomplish (or what your friend is trying to accomplish, as the case may … | |
Re: Each variable has both an address and a value. After line 3 above executes, you have: * a (address = 0xFF2A, value = 32.5) * b (address = 0xFF2E [since each `float` takes 4 bytes], value = unknown [`*`]) after line 4 executes, you have: * a (address = 0xFF2A, … | |
Re: I'd like to start with your looping structure. At line 18 above, `if (baris == 1)`, since this is after the loop of baris over the range [0, bintang) is done, baris can only be 1 if bintang was also 1. And bintang == 1, looking at the outer loop, … | |
Re: > Base from what I read so far > 1. the image is divided into 8x8 sub-blocks > 2. then DCT is applied to each of the sub-blocks. I'm stuck here what happens next? What happens next is specific to the image-file-format. For instance, for lossy compression in the JPEG … | |
Re: I want somebody to do all my work for me too. But that's not how it works here on DaniWeb. Here, **you** write the code, and if there's something you don't understand, or if you're stuck on a particular point, you post the code you've written so far, along with … | |
Re: int num_rows = 10, num_cols = 2; int row, col; // allocate: a set of rows, then the set of columns for each row int **vals = new int * [num_rows]; for (row = 0; row < num_rows; row++) vals[row] = new int [num_cols]; // delete what you allocated, in … | |
| Re: I suspect your error is a "Segmentation Fault", which typically results from trying to access an uninitialized (or already deallocated) pointer. With any luck your "some processor fault error" message actually includes a specific error code number, and maybe even the line of your program where the error occurred. That … |
Re: > // I have no idea what goes in the constructor Do you have some idea what the members of the class will be? So far, you haven't specified any. Also, your constructor and set() methods should not be private, otherwise there's no way for any code outside of the … | |
Re: You haven't failed. You just haven't gotten to the answer yet. I don't think the project is necessarily beyond what you've learned so far. If you have categories, then each category contains an array of words. If the number of words is **up to** 7, then each category must also … | |
Re: Hi Nathaniel, excellent work over all. (Sorry to be jumping in here, but that's how it works some times!) Line 75 in your Delete() method is almost certainly not what you meant (though it looke like line 77 is good). What does it mean if Previous_ptr is NULL, and what … | |
Re: Please write complete words. Your txting shorthand makes my brain hurt. The first thing I see is within your `main()` in main.cpp, you're recursively calling `main()`. Don't ever do that; a number of compilers won't even compile it. `main()` is the entry point from the operating system into your program. … | |
Re: When you copy the elements of list1 into list2, you're copying the pointers to the FileInfo objects, so that `list1[i]` and `list2[i]` both point to the same allocated FileInfo instance. Either create a copy-constructor FileInfo(const FileInfo &other): a(other.a), b(other.b), ... {} or make your lists of `<FileInfo>` instead of `<FileInfo … | |
Re: In test2, where it fails to find the value of 40 in the node after 30, print out what it **did** find (or "no next node" if is_item() fails). Same for other tests. A useful debug method might be `printEntireList()`, which can avoid using the other methods (so as not … | |
Re: Ignoring the fact that you define, but don't call, `enter_password()` and `enter_name()` functions ... at line 25, you get some input and assign it to variable `pwrd`, but at line 26, you're trying to check the value of variable `input` which you haven't assigned at all. And the way you … | |
Re: At line 232 above, you're always reading into the 1000th position of the array, which doesn't even exist (valid indices are from 0 to 999). I think you meant `&customer[track]`. Then at line 255, you're trashing your value of track by assigning to it the value of getche(). Use a … | |
Re: Looks like you might need to write your own, if you need full RTF support. See [wikipedia](http://en.wikipedia.org/wiki/Rich_Text_Format), especially the "Implementations" section for an idea of where to look for help. | |
Re: In at least two places, your for() loop looks like this: for(int location = 0; location > tableSize; location++){ I think you mean `location < tableSize;`. | |
Re: Instead of `if (inputFile)`, try `if (inputFile.is_open())`. And when posting your code, please select all of it and click the **Code** button at the top of the editor, or just hit the tab-key to do the same thing. Then all of your code will get line-numbered and formatted together, instead … | |
Re: Let's start simple. Do you understand Part 1 of the assignment? Can you code that much up and see if it will compile? Then can you use create an instance of the class, use the setters to populate the instance, and the getters to verify the values? Third, add a … | |
Re: This should get you started: template<class Datatype> class DListNode { public: //********Member Variables******** Datatype m_data; DListNode<Datatype>* m_prev; DListNode<Datatype>* m_next; //*********Methods******** ... }; | |
Re: Usefulness, like beauty, is in the eye of the beholder. The most useful program you can write, to practice the basics, is one that would be useful to **you**. Write your own address-book / contact-list program, that lets you store and find the info you want **your** way. Own a … | |
Re: I'm not entirely sure, but if you're working in Visual Studio, it gets very fussy about the definition of main(). I'd recommend creating a new project of the desired type ("Console Application" is probably best), and then including "Planet.h" and any other additional includes at the top, and pasting the … |