3,183 Posted Topics
Re: Have you read [Beej's guide](http://beej.us/guide/bgnet/) to socket programming? | |
![]() | Re: It must be nice to have a job where you can ask other people to do your work for you. :rolleyes: |
Re: > but it literally FELL APART. Literally? Wow, I would love to have seen that happen. ;) | |
Re: > @NP-complete, the word inclusive in pseudo code means you do not include the value in your range. Actually, it's the other way around. Exclusive means that an end of a range is not included and inclusive means that an end of a range *is* included. The square bracket means … | |
Re: Not enough information. The only thing that *might* be a problem in the code you posted is `&theArray[10]` potentially being an out of bounds index. | |
Re: The virtual machine would have its own registers simulated to match the simulated platform. Nothing else would make sense given that the host could be running a number of virtual machines. | |
Re: That's by design. The button goes away to ensure that you don't click it again (and thus create a duplicate post) while the submit code is running. Just be patient, it should finish in a few moments at most and then refresh to show your new post. Sometimes server load … | |
Re: While RLE is pretty straightforward, the encoding of the result can vary. So it's difficult to answer your question without knowing what kind of encoding is being performed to achieve that result. Where did you get the example? | |
Re: I'm baffled by all of the people who manage to reach their thesis yet still have no clue how to come up with a title for it. | |
Re: Um...what? So you're trying to traverse an array with a do..while loop in forward order? int i = 0; do Console.Write(array[i] + " "); while (++i < array.Count); Or if you can't have a counter starting from 0 and must have a descending counter starting from `array.Count`, the difference of … | |
Re: It works fine on my end. What numbers are you typing? What compiler and OS? As Nathan asked, what does "it just stops" mean? | |
Re: Those characters are interpreted as HTML. Wrap the code in <pre> or <code> tags and replace those characters with their HTML escape codes if necessary (ie. < and >). | |
Re: > Im just a beginner so please keep it simple for me The problem is that it's not simple. You can tell C++ to write Unicode characters until you're blue in the face, but if the console isn't set up to support Unicode or using a font that supports those … | |
Re: It's easy to perceive rudeness from someone who's trying to help, especially if they tend to cut through the bullshit and tell things like they are. **If you think someone is really acting out, please report the post so that a moderator can deal with it.** Creating a thread like … | |
Re: By default std::sort() uses operator< to handle the relation between items. Since you have neither an overloaded operator< nor specify a custom comparison function, of course it doesn't work. Consider using the three argument version of std::sort(). You can find details and examples [here](http://www.cplusplus.com/reference/algorithm/sort/). | |
Re: > THE ABOVE CODE DOES NOT RUN USING DEV C++ WHAT SALL I USE TO RUN IT? At a glance it doesn't look like the code uses anything that Dev-C++ shouldn't be able to handle. What errors are you getting? | |
Re: > how? The same way you got data into the datagridview in the first place. | |
Re: > cin.ignore(cin.rdbuf()->in_avail(),'\n'); There's no guarantee that in_avail() will give you a meaningful value. In fact, GCC always returns 0 by default. The correct way to use ignore() would be asking for up to the maximum possible stream buffer size: cin.ignore(numeric_limits<streamsize>::max(), '\n'); There's a [sticky](http://www.daniweb.com/software-development/cpp/threads/90228/flushing-the-input-stream) that highlights all of the issues … | |
![]() | |
| |
Re: Start with spelling and grammar. All the technical knowledge in the world won't get you a job if your level of communication is only competitive with pubescent girls texting on their smart phones. | |
Re: > Is that really true? The powerpoint says that the number m *should* always be odd, not that it *must* be. Hopefully the course that the powerpoint supplements would cover the reasoning for that. I assume it's due to simplified splitting and merging algorithms. | |
Re: That usually only happens when you're trying to open or copy/paste files that were written on another system or with a less than friendly text editor. Does it happen when you write code directly in Code::Blocks? | |
Re: > There's some edge cases that could make it somewhat complex. Yes, but they have nothing to do with long lines. ;) > Mostly because you could have lines bigger than your buffer. Actually, this is a good place for an extended fgets() that isn't restricted by a buffer size: … | |
Re: 0xFEEEFEEE is used to mark freed memory in Visual C++. You're using a dangling pointer after deleting it. | |
Re: "KML" isn't a meaningful integer value. Presumably since the ID cannot work as an int, your only option is to return a string.: public string getRandomID() The function also doesn't return a value in all execution paths. What if `value` doesn't match "Men Formal"? | |
Re: [Click Here](http://lmgtfy.com/?q=binomial+queue+insertion+algorithm). > and is tt there a concurrent access to binomial queue Not natively, no. But you can write your data structure to support concurrency. | |
Re: That's like asking how to make an operating system. Antivirus applications aren't trivial, so your best bet would be to find an [open source antivirus](http://lmgtfy.com/?q=open+source+antivirus) project and study how it works. And nobody will give you source code because it would be hideously long. | |
| |
Re: Actually, since the questions are of a more technical nature and concerning the development of a web site, I don't think Business Exchange is an appropriate location. This location is probably fine. | |
Re: http://docs.oracle.com/cd/E19957-01/806-3568/ncg_goldberg.html | |
Re: > would jephthah's code work with outputting to the SAME file? Not as-is. To be completely safe you'd want to write to a temporary file first. Then delete the original and rename the temporary to the original. Reading from and writing to the same file line by line, if it … | |
Re: By perfectly balanced do you mean a complete tree? A full tree? Merely a height balanced or weight balanced tree? The algorithm is different for each. Typically what's meant is height balance, or what would be the desired end structure maintained an AVL tree. A recursive algorithm presents itself immediately … | |
Re: > Do I recall that you used to be able to do this? In profile, you could click on the avatar and if a member had uploaded a pic of themselves, that would show? Or did I dream it? Yup, you used to be able to add a profile picture … | |
Re: You've stumbled on one of the tricky points of mixing signed and unsigned values. The result of the sizeof operator is unsigned, but d is signed and negative. You can just pretend the comparison looks like this, because that's what actually happens: for (d = -1; (unsigned)d <= (TOTAL_ELEMENTS - … | |
Re: >Are you trying to get answers to your own questions? To date I've always been able to find my own answers in other ways. I'll usually start with reading the manual, then a web search, then asking coworkers, then calling support if that's relevant, and experimentation or reverse engineering as … | |
Re: Child implicitly calls the default constructor for Parent, but Parent doesn't have a default constructor because you explicitly defined a single argument constructor. The quickest solution would be to modify your current constructor to have a default argument such that it also acts as a default constructor: Parent(double n = … | |
Re: > Lucaci Andrew i've been using that method for a while now but i'm not comfident that this method is the best one to use. That's the only way you're going to get the syntax you want, given that the membership operator can't be overloaded. Are you sure that the … | |
Re: > Oh ok so would it just be like: No, not really. You're summing the contents of the array, so `num` should control the loop and index `a` for the value. You also need to return the average rather than store it in a local variable: double tableAverage(double a[], int … | |
Re: > The problem I am having is creating objects inside of the program, is this even possible? Yes, of course it's possible. Otherwise objects would be nigh useless. > Is this above even possible? Not without enough difficulty to make it impractical. What you probably want are unnamed objects, or … | |
Re: > how to resets the transactioncount zero in child class checkaccount How about a public Reset() member function that does it? void checkaccount::Reset() { transactioncount = 0; } Resetting that count seems off to me, since presumably it's internal data that the caller shouldn't have access to, but I'm not … | |
Re: Not with the standard Windows Forms combo box control. You'd need to extend and modify it to add sub menus, or use a third party control that already does this. You might have that kind of control with WPF, but I'm not familiar with WPF, so someone else will need … | |
Re: You have a number of problems in the code. Please be patient for a moment while I list them out. > '#include<conio.h>' Use of this library should be avoided except in cases where it really does offer the best solution (which is extremely rarely). > printf("How long is the string:"); … | |
Re: You've pretty much described the use case for static data members: #include <iostream> class BankAccount { public: void Credit(double amount) { std::cout<<"Crediting "<< amount <<'\n'; ++transactions; } void Debit(double amount) { std::cout<<"Debiting "<< amount <<'\n'; ++transactions; } int Transactions() const { return transactions; } private: static int transactions; }; int … | |
Re: Start by reading up on [how to parse command line arguments](http://lmgtfy.com/?q=C%2B%2B+command+line+arguments). Then see what you can come up with based on what you learn, and if you have any specific problems or questions, don't hesitate to ask. It's very difficult to tell you how to do this without making assumptions … | |
Re: http://docs.oracle.com/javase/tutorial/essential/io/formatting.html | |
Re: > But when i compile and run it, it gives me errors. What are the errors? Seriously, would you go to an auto mechanic and say "something's wrong" and expect them to find the problem you're thinking of? | |
Re: > To save on time we are setiing the timer tick event to occur every 5 sec which is equal to 1 hour. Is this a simulation or something? > only happens on the first instance of the tick event You're using DateTime.Now as the starting point for the hour … | |
Re: The towers of Hanoi program is a very common homework exercise. Please provide some proof of effort if you want any help. Whether you intended it to or not, your question reads like "gimme gimme gimme" with no intention of doing any work. | |
Re: > how do I keep on comparing it til the stack is null or the precedence don't hold true anymore? Use a loop. ;) The algorithm should look something like this: for each character if whitespace next else if not an operator append the current character to postfix else until … |
The End.