3,183 Posted Topics

Member Avatar for virendra_sharma

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.

Member Avatar for deceptikon
0
82
Member Avatar for sainisunil05

`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?

Member Avatar for Moschops
0
95
Member Avatar for nitin1

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 …

Member Avatar for Banfa
0
311
Member Avatar for cosmosthompson
Member Avatar for deceptikon
0
97
Member Avatar for Dani

> 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 …

Member Avatar for deceptikon
0
145
Member Avatar for admin-pc
Member Avatar for salahelsafiiom
Member Avatar for furalise

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.

Member Avatar for furalise
0
4K
Member Avatar for Smeagel13

> 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 …

Member Avatar for Smeagel13
0
296
Member Avatar for dokz23

While Daniweb has no rules against creating multiple accounts, this pattern strongly suggests spammer behavior. We're watching these folks closely.

Member Avatar for JorgeM
0
185
Member Avatar for nitin1

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.

Member Avatar for deceptikon
-1
139
Member Avatar for nitin1

> 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 …

Member Avatar for deceptikon
0
127
Member Avatar for ManthanB

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> /// …

Member Avatar for deceptikon
0
4K
Member Avatar for emanueltim

> 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 …

Member Avatar for abadonabadon
0
251
Member Avatar for lemongardens

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.

Member Avatar for Ancient Dragon
0
134
Member Avatar for GregXaiver

> 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) { …

Member Avatar for GregXaiver
0
169
Member Avatar for Jake.20

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.

Member Avatar for Jake.20
0
533
Member Avatar for Violet_82

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.

Member Avatar for Violet_82
0
271
Member Avatar for stultuske

Sounds like a glitch. Has it happened on any other threads or just that one?

Member Avatar for stultuske
0
192
Member Avatar for NardCake

> 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. ;)

Member Avatar for Zagga
0
217
Member Avatar for harinath_2007

> 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 …

Member Avatar for deceptikon
0
140
Member Avatar for Xantipius

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 …

Member Avatar for Agilemind
0
330
Member Avatar for mehra.hiten

They'd probably charge you extra. Do you *need* a static IP for some reason?

Member Avatar for abcuizon
0
165
Member Avatar for Lucaci Andrew

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, …

Member Avatar for ndeniche
0
472
Member Avatar for Tevin985
Member Avatar for shark101

> 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() …

Member Avatar for raptr_dflo
0
279
Member Avatar for JamesCherrill
Member Avatar for Lee Stone

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 …

Member Avatar for Lee Stone
0
342
Member Avatar for sourabhyogi

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 …

Member Avatar for sourabhyogi
0
269
Member Avatar for siddiquedu

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';

Member Avatar for siddiquedu
0
253
Member Avatar for treasure2387
Re: MSIL

> 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. ;)

Member Avatar for treasure2387
0
156
Member Avatar for zachattack05

> 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 …

Member Avatar for zachattack05
0
139
Member Avatar for DanDaMan

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.

Member Avatar for sanjila007
0
1K
Member Avatar for riahc3

> 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 …

Member Avatar for deceptikon
0
237
Member Avatar for dualstar

> pls,can you explain in detail? You can't ask a vague question and expect a detailed answer.

Member Avatar for deceptikon
0
29
Member Avatar for ManthanB

Could you summarize the many solutions you've tried unsuccessfully so that we can avoid wasting your time recommending solutions you've attempted?

Member Avatar for deceptikon
0
64
Member Avatar for Ancient Dragon

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 …

Member Avatar for deceptikon
0
174
Member Avatar for ndeniche

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.

Member Avatar for ndeniche
0
391
Member Avatar for maml

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* …

Member Avatar for annaharris
0
389
Member Avatar for castajiz_2

> 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 …

Member Avatar for Momerath
0
161
Member Avatar for varunsara

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.

Member Avatar for eburlea
0
417
Member Avatar for asif49

> 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 …

Member Avatar for diafol
1
377
Member Avatar for sushants

> 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 …

Member Avatar for deceptikon
0
163
Member Avatar for chrispitt

> 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 …

Member Avatar for deceptikon
0
176
Member Avatar for jaejoong

> 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(). ;)

Member Avatar for jaejoong
0
109
Member Avatar for ferizhandi

"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 …

Member Avatar for Schol-R-LEA
0
170
Member Avatar for new_developer

> 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 …

Member Avatar for deceptikon
0
245
Member Avatar for aVar++

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 …

Member Avatar for diafol
0
562
Member Avatar for Rogierownage

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) { …

Member Avatar for c0DEZOMBIE
0
168
Member Avatar for Violet_82

> 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 …

Member Avatar for Violet_82
0
504

The End.