6,741 Posted Topics
Re: The code is trivial. Try doing it yourself first before resorting to cheating. | |
Re: >one assignment is Functional data base, business system report,Risk Management I can guarantee that you won't get as much help here as you would in the correct forum, but your question is too vague for me to determine which forum would be best suited. Please elaborate. What class is this … | |
Re: [QUOTE]noobs are continually posting mountains of unhighlighted code, and its just nearly impossible to read such messes without highlighting... i dont even want to try, it hurts my head.[/QUOTE] Dammit jephthah, you're making me feel old now. When I started posting to forums there wasn't highlighting. We were thankful when … | |
Re: >but it seems that this generator isnĀ“t really random Any deterministic method for generating random numbers won't be "really" random. That's why they're called pseudorandom numbers. They're sufficiently patternless to [I]appear[/I] random for many purposes. "Real" random numbers only come from truly random real world sources, such as the decay … | |
Re: >And when I do Visual Studio 2005 reports: That's because you changed only half of the equation. In the code as posted, you create a list of Vehicle objects and populate it with the Vehicle half of SportsCar objects (an effect called slicing). When you changed the list to take … | |
Re: >Why can't I use float data type to define my own boolean type? One reason might be because the comparisons are trickier. Depending on how you set this up, it could involve fudge factor comparisons, which are completely unnecessary when it comes to the concept of booleans. >Can I use … | |
Re: >let us give him one more chance? He'll get another chance: when he's automatically unbanned after the infractions expire. >despite all odds he was a valuable poster. >we need to take his age into consideration as well There are no exceptions, no double standards. It doesn't matter if you're the … | |
Re: >now for balanced >B - O(1) >A - LOG(N) >W - 0(N) You're not thinking in terms of scalability. The best case performance for a balanced binary search tree during search operations is O(log N), so is the average and worst case, which is why balanced trees are so desirable. … | |
Re: >fgets places '\n' char at the end of string. To the OP: ArkM's code does the right thing, but the quoted statement is incomplete. fgets preserves the newline, but not if the buffer is filled. So solutions like the following distressingly common one are incorrect: [code=c] if ( fgets ( … | |
Re: >Not the express edition ? The C/C++ compiler is identical in all editions. >without the platform SDK it cant make standard Win32 apps, making it .NET only. Well, technically Win32 applications aren't "real" C++ either. Only standard C++ is "real", and you can write both standard C (C95) and standard … | |
Re: effective, this isn't a chat room. If you don't have anything to add then please don't reply. If everyone posted things like "Nice!" or "I agree!", then it would become difficult to find the useful information in a thread. If you must share your enjoyment of a post, add to … | |
Re: >hey Salem i didn't ask my question to get links or somethin Of course not. You probably asked with the intention of having someone else find and point out the problems for you. That way you can finish the program and not have to think. >cuz i'm almost sure that … | |
Re: [QUOTE]I have asked a few people and most of them tell me that trying to learn java is no good if I already dont know C++, because then I will not know what the concept of "classes" is, and therefore will not be able to understand Java properly.[/QUOTE] They're full … | |
Re: Good, god. Haven't you ever heard of proofreading? And to answer your question, jealousy is fine as long as you use it productively. | |
Re: >2.1. Write a recursive value-returning function that searches a linked list >2.2. Write a recursive value-returning function that returns the maximum value in a linked list "Recursive" and "linked list" are generally not terms that should be used in the same sentence. A linked list is normally a linear structure, … | |
Re: >it's probably because you aren't freeing the block >of memory you're allocating in your call to malloc No, it's probably not. Even if the process doesn't release allocated memory when it terminates, all you're likely to get is leaked memory, not a segmentation fault. >memcpy(&pData, &t, sizeof(t)); >memcpy(&a, &pData, sizeof(t)); … | |
Re: An interface is just that: an interface. You need to implement it in another class, then you can use it through that class: [code=csharp] public class Foo: DS.GS.Admin.BrokerAdmin { public int GetCount() { return 12345; } } [/code] [code=csharp] Foo foo = new Foo(); BrokerAdmin ba = foo; Console.WriteLine( ba.GetCount() … | |
Re: >>>Is this the right way to do it? >No. No. When you use nothrow, new returns a null pointer instead of throwing bad_alloc. Your catch is also malformed. ;) | |
Re: So what's the problem? | |
Re: >what shoul i do???? Post more code (preferably something bare bones so we're not overloaded with unnecessary crap). currentSize isn't even defined in that snippet. | |
Re: >ya links does not help. The Eternally Confuzzled link goes to my website. Could you explain why that tutorial didn't help so that I can improve it? | |
Re: What do you know about new[] and delete[]? If the size has to be variable then you're going to end up messing with dynamic memory, as I assume you can't use the std::vector class. Here's some code to get you started: [code=cplusplus] int **p = new int*[M]; for ( int … | |
Re: Each one designate a level of indirection (a pointer). So you can say that adj_matrix is a pointer to a pointer to int. My spidey sense says that adj_matrix is intended to be a dynamically allocated adjacency matrix, so you can do a google search for dynamic arrays in C++ … | |
Re: You had an assignment in your inner loop condition rather than a comparison. I also added the code to insert the new columns as it's an identical operation to inserting the new rows: [code=cplusplus] #include <iostream> #include <vector> using namespace std; int main() { vector<short>vec; vector< vector<short> >vec_2d; vector< vector<short> … | |
Re: >it seems to be assigning it to the address of the pointer, not the value of the pointer Yep, seeing as how that's what you told it to do. Unless you do some dereferencing, you can expect to be working only with addresses. >so I'm wondering how to make it … | |
Re: Okay, I wasted my time reading that post thrice trying to figure out what the hell you need help with. Would you care to ask a question that actually makes sense? What are these "the functions" you keep vaguely mentioning? | |
Re: It's hard to say without seeing your code, but I'd wager your cast is wrong. Compare your code with this skeleton and tell me if you're doing something equivalent: [code=cplusplus] #include <iostream> class A1 { public: int a1; virtual ~A1() {} }; class A2: public A1 { public: int a2; … | |
Re: >Since Generics were introduced, link lists are pretty much useless in the real world. It's certainly true that you should prefer a standard library to hand-rolled code in most real world cases. However, just because there's a library that will do it for you doesn't mean you don't still need … | |
Re: The error is saying that you declared the FlightManager constructor ([ICODE]FlightManager();[/ICODE]) but never defined it. You must give a body to any functions before you can call them. | |
Re: >So what I know is that virtual function is equal to abstract functions. No. An abstract function is a placeholder that has no definition and requires derived classes to implement it. A virtual function can have a definition, and in such a case will be silently inherited without any action … | |
Re: >can any of u explain the order of constructors It's in the order of declaration, from base classes to derived classes. Take B1, B2, and V2. The diagram doesn't (and can't) specify whether B1 or B2 is called first because that would depend on the declaration order. This will print … | |
Re: I think you need to differentiate between a class and an object. A class is a blueprint, a type definition: [code=csharp] namespace JSW { public class Foo { public Foo() { Console.WriteLine ( "Foo!" ); } } } [/code] Once you've defined the type Foo, you can create objects of … | |
Re: >panel1.Height=this.BackColor.ToString(); I'm not entirely sure what you hoped this would do, but if you want to change the color of the panel, you need to change the BackColor property. For example: [code=csharp] panel1.BackColor = Color.Yellow; [/code] And this is a separate statement from changing the height. | |
Re: In my experience, a large amount of data will slow down the grid regardless. Perhaps if you have that much data, you should page it so that only a fraction (one page) is loaded and visible at one time. Then you can divide the data into pages such that the … | |
Re: If you have getch, you might have kbhit. That would be the easiest solution. | |
Re: >I'm trying to have a pointer point to anothier pointer. How do you make a pointer point to a non-pointer? Just add a level of indirection: [code=cplusplus] int x = 12345; int *px = &x; // Add a level of indirection int **ppx = &px; // Same thing! Woo-hoo! std::cout<< … | |
Re: >I am getting a segmentation fault when i run the follwing program. How does your code handle N^0? >Code tags work sometimes and code tags donot work. Define "do not work". | |
Re: Closed as spam bait. | |
Re: >My problem is I would like to create a seperate array of characters for each element of that array. To what end? There are ways to do what you want, but I'm not entirely sure what you want makes sense. | |
Re: Sorry, we don't give homework help without proof of effort on your part, and we don't give away homework answers. If you want to cheat, go elsewhere. | |
Re: Do your own homework. Daniweb is not a cheating service. | |
Re: If your brain is going numb, it probably means you're overwhelmed with everything that needs to be done. Break the problem down into multiple smaller problems, then solve each one individually. The requirements are pretty specific about what the result will look like (three functions, dynamic allocation, blah blah blah). | |
Re: You've already pinpointed the problem. You're storing the address of your input buffer rather than making a copy of the input string. As such, all references to the color will reflect the current contents of the buffer. If you don't want that, you'll have to make a copy each time. | |
Re: [URL="http://www.catb.org/~esr/faqs/smart-questions.html#rtfm"]RTFM[/URL] | |
Re: Alright serkan sendur, that's quite enough. I've been ignoring your creepy and unhealthy fascination with me thusfar, but now you're getting dangerously close to harassment. | |
Re: >Do you also think that unix and programming on unix sucks? Unix is fabulous and programming on Unix is sheer joy. X programming on Unix is what sucks. I think more programmers have lost their sanity to X than MFC. | |
Re: >recNo*20 + sizeof(double) Presumably when recNo is 0, you want to seek to the 0th byte. But because the multiplication is done first, you get the (0 + sizeof(double))th byte. | |
Re: You only have one loop rather than two. For a program such as this I would expect an outer loop to manage the number of strings that are processed and an inner loop to handle processing a string: [code=cplusplus] do { char ch; while ( cin.get ( ch ) ) … | |
Re: Hmm, did you try actually [I]setting[/I] the data member in your second constructor? | |
Re: >I havent time to do it. I can only imagine what your professional life would be like: Boss: Welcome to your new job! You: Thanks! Boss: Here's you're first assignment. You: I haven't time to do it. You do it for me. Boss: You're fired. If you don't do your … |
The End.