3,183 Posted Topics
Re: An object is an instance but an instance isn't necessarily an object. They're both concrete entities based on a reference type or value type blueprint, but a value type instance should not be described as an object unless you box it. | |
Re: `number` is a local variable whose lifetime ends when the constructor terminates. What do you suspect happens when the lifetime of the reference exceeds the lifetime of the referred? | |
Re: It's parenthesized like this: int m = (i++ || (++j && k--)); But || is still a left to right short circuiting operator, so `i++` is evaluated first. If it evaluates to true, `(++j && k--)` doesn't get evaluated. But if `i++` evaluates to false, the right hand side of … | |
| |
Re: > So I did some investigation, and our community activity took a DRAMATIC 30% hit the day that we switched over from vBulletin to our new proprietary platform, and never recovered since, despite traffic levels. Out of curiosity, are you accounting for the spammers that were overwhelming us prior to … | |
Re: Please read our rules concerning homework and proof of effort. | |
Re: Because there's no overloaded operator>> that does this for you. It's simple enough to write, though you could just as easily reverse the operation and dump cin into Mystr: Mystr << cin.rdbuf(); That's probably why the overloaded operator doesn't exist, it's unnecessary. | |
Re: > Not sure why though, yet... malloc() is required to give you a block with suitable alignment for any type. That's why it can return a pointer to void which you can then assign to any object pointer type. On your system aligning to the largest scalar type just happens … | |
Re: While Daniweb has no rules against creating multiple accounts, this pattern strongly suggests spammer behavior. We're watching these folks closely. | |
Re: Swap the data with the next node and then delete that node. This trick is obviously incomplete and its suitability depends on the design of the list, but if you're working with unreasonable requirements, you often have no choice but to enforce unreasonable limitations on the solution. | |
Re: > some O(n) is acheivable, but not getting how can it be O(n) I can immediately think of an O(mn) solution where m represents the length of these strings, but strictly O(n) kind of ignores the fact that you're dealing with collections of characters **or** assumes that some constant form … | |
Re: The System.Windows.Media libraries make this so easy as to be trivial: public static class ImageProcessing { /// <summary> /// Encodes the provided TIFF file with new compression and pixel format. /// </summary> /// <param name="path">The source TIFF image file.</param> /// <param name="compression">Desired TIFF compression.</param> /// <param name="format">Desired pixel format.</param> /// … | |
Re: > I am planning to promote my blog through blog commenting.Is it a good idea? If your comments contain substance and aren't just a veiled attempt at spamming your blog, it's a great idea. Otherwise, you're more likely to piss people off and ensure that they never visit your blog … | |
Re: If you aren't already familiar with the material or what will be on the exam to guide people providing examples, then I strongly doubt random examples will help you. | |
Re: > 1) When you compare a range such do you use && or do you use the or statement to compare them? You can use either, but typically the result is reversed between then: // Compare range [lbound, ubound) using && if (x >= lbound && x < ubound) { … | |
Re: I don't see SqlDbType.Int in any of your parameters. If the error is complaining about converting varchar to int, then it seems one of your columns is defined as an integer and you need to treat the parameter accordingly. | |
Re: We may be checking for the wrong MIME type. I'll see what I can see when I get a chance to run some tests. Our company (my day job, not Daniweb) just got sold, so this week may be hectic for me. | |
Re: Sounds like a glitch. Has it happened on any other threads or just that one? | |
Re: > Basically any cookie that is not required for the site to work needs confirmation first Technically any cookie that the site uses is required for the site to "work", because lack of the cookie would be removing a "feature" of the site that would otherwise be provided. ;) ![]() | |
Re: > It's possible, although I have yet to see one that works well. Technically it's not possible due to how compilation works (even for .NET languages). However, in some cases (.NET languages for example) a decent facsimile is possible by disassembling the executable and then interpreting the disassembly to the … | |
Re: Did they break down what exactly was smoked or is it just any kind of burning tobacco constitutes a smoker? *[rant]* I've seen an unfortunate trend in smoking studies to lump pipe and cigar smokers in with cigarette smokers. There's a significant difference between the chemical components of cigarettes and … | |
Re: They'd probably charge you extra. Do you *need* a static IP for some reason? | |
Re: Given the choice between making the experience for new members worse, and asking mods to move a few threads every now and then from a well defined and consistent drop location, I'd favor the latter. The Community Center is a good spot too, because regardless of our individual favorite forums, … | |
Re: The code didn't make it through. | |
Re: > i am trying to google too but i cannot find any info on this. You may have better luck if you search for ["strdup implementation"](http://lmgtfy.com/?q=strdup+implementation). Your copyString() function already has a de facto name of strdup. The implementation is dead easy, but you'll need to remember to call free() … | |
Re: I'm not sure I understand exactly what you're asking, but initialization lists can be nested: int foo[2][2][3] = { { {1, 2, 3}, {1, 2, 3} }, { {1, 2, 3}, {1, 2, 3} } }; If the values of the array aren't known at compile time then you're stuck … | |
![]() | Re: Here's an example of how to inspect the first character of a "word" and respond to it's type (either a digit or not). Note that this program doesn't do what your requirements state, but it can be used as a template. So don't complain that I didn't solve your exact … ![]() |
Re: Just make a sum variable and accumulate the results into it: int sum = 0; for (int i = 0; i < size; i++) { sum += (test[i] - test[0]); } cout << "Sum of differences: " << sum << '\n'; | |
Re: > Are the different high level languages translated into the same MSIL language? Yes. All of the CLI languages ultimately get translated down into CIL (previously known as MSIL). That C stands for "common", after all. ;) | |
Re: > how often have you upgraded your Visual Studio version? I upgrade to the latest version shortly after it's released (since VC6), but for testing purposes rather than business use. For business use, I tend to wait until the first service pack or major update so that any bugs and … | |
Re: For future reference, errors and warnings are not synonymous. Errors *must* be fixed because they halt compilation. Warnings can be ignored, though in some cases they suggest problems that are likely to occur at runtime. Since your compiler clearly supports the modern headers, it's recommended that you use them. | |
Re: > Always change that as well. > n=n+1; I hope you're not changing code that someone else wrote just to suit your own aesthetic preferences. That's an excellent way to introduce bugs. I'd also argue that your preference is unconventional and will cause programmers to stumble over your code not … | |
Re: > pls,can you explain in detail? You can't ask a vague question and expect a detailed answer. | |
Re: Could you summarize the many solutions you've tried unsuccessfully so that we can avoid wasting your time recommending solutions you've attempted? | |
Re: I just want to double check the reproduction steps, because the following worked as expected for me: 1. Click on the up arrow to add a positive vote. 2. Refresh and verify that the vote applied. 3. Click on the up arrow again to reverse the positive vote. 4. Refresh … | |
Re: I've seen these as well, and it's somewhat frustrating given the point of tags. I'll look into a programmatic solution, but in the meantime, please report those posts so that a mod can fix the tags. | |
Re: Normally I'd say not to micromanage piddling stuff like this. However, C++ has gotten more quirky over the years in that seemingly piddling things can have a nontrivial effect on performance. In this case though I would be quite shocked to see any justification for either of those options *other* … | |
Re: > So my question is will i ever understand recursion That's entirely up to you. > how did you understand it I worked through recursive problems, traced recursion, converted between recursive and stack based approaches, converted between recursive and non-stack based iterative approaches, and learned programming languages that naturally tend … | |
Re: The simple solution is to ask visitors what timezone they're in and calculate the date from the offset. A less simple solution is to use Javascript/AJAX to acquire the date-time from the client side and pass it to the server for processing. | |
Re: > Having done software development however I'm not sure if it satisfies me on a personal level. Find a job you can tolerate and which doesn't eat up all of your time. When you see a better opportunity, take it. Don't forget that a job is nothing more than how … ![]() | |
Re: > What is the dfference between realloc() and free()? free() performs a task that is a subset of realloc(). Here's what realloc() does: * `realloc(p, n)`: Changes the size of the block pointed to by p and returns p. If the size of that block cannot be changed, allocates a … | |
Re: > How should i decide which integer type to use? When in doubt, use `int`. If `int` doesn't have the range you need or if you have special needs (eg. heavily restricted memory) that justify a smaller integer type, use something different. Over time you'll get a feel for which … | |
Re: > I answered my own question :D Technically that's not the correct answer to your question, though it's close. Your question was how to extract "sample.xls", not "sample". In that case you need Path.GetFileName(). ;) | |
Re: "8a" is two characters, but you actually typed three. Count each key you press when running this test, and the remaining character will become clear. That character is pulled by the second read() call and due to this that call will not block for further input. This is a variation … | |
Re: > What is the easiest way to declare and initialize 2d dynamic array in class in C++ ?? By far the easiest way is to use the vector class: vector<vector<int>> foo; // 2D vector of int Given that std::vector is essentially required to be implemented as a dynamic array, this … | |
Re: One shouldn't expect people to consistently vote on every post one makes, it's really all about who sees it, what their opinion is, and if their opinion is strong enough *at the time* to make a vote. Further, votes are completely subjective and not restricted to any guidelines (barring personal … ![]() | |
Re: To avoid having to read all of your code (laziness on my part, most assuredly), I'll just point out that your Wait_Secs() function is needlessly complex. It can be as simple as this if you make an assumption that time_t represents seconds (not an unreasonable assumption): void Wait_Secs(int seconds) { … | |
Re: > I remember some time ago you had a list of file types that could be uploaded on the site, I can't see that anymore, why has it been removed? I strongly doubt it was removed, given that we don't delete threads unless they're essentially pure crap that violate the … |
The End.