3,183 Posted Topics

Member Avatar for obinaysamanoden

> cin.sync(); // 'flush' cin stream ... Sadly, [it's not that easy](https://www.daniweb.com/software-development/cpp/threads/90228/flushing-the-input-stream). `istream::sync` is in no way guaranteed to read and discard remaining characters in the stream. The best approach, in my opinion is either 1) don't depend on the stream being 'clean' in the first place or 2) ensure …

Member Avatar for David W
0
280
Member Avatar for Habib_7
Member Avatar for deceptikon
0
108
Member Avatar for PHENYO A

> Please help me with reasons or ideas to support the above statement To qualify Davey's hilarious response, your "question" reeks of homework. As such, we'll require that you put some effort into starting a dialogue by offering the reasons and ideas you already have. Otherwise, we'll be forced to …

Member Avatar for deceptikon
0
223
Member Avatar for ms95
Member Avatar for habib_6

If there's a write error to the destination stream, you'll get a return value of `EOF`. Typically this means something along the lines of the target device no longer being available or getting corrupted. However, since `puts` writes to `stdout`, this is rather unlikely unless you've redirected `stdout` to a …

Member Avatar for rubberman
1
115
Member Avatar for ddanbe
Member Avatar for JOSheaIV
0
243
Member Avatar for PulsarScript

> can it be omitted in this case? Yes, a `default` case can be omitted if you already cover all of the possible cases, or not executing any of the cases wouldn't be damaging.

Member Avatar for TekknoDraykko
0
148
Member Avatar for Sheeraz_1

A blank string is indeed not a valid path. Either you need to account for the possibility of a blank string and act accordingly, or ensure that the blank string doesn't happen.

Member Avatar for TekknoDraykko
0
287
Member Avatar for Computer Savy
Member Avatar for TekknoDraykko
0
273
Member Avatar for bnmng

Databases are pretty fundamental to both parent categories, and while I can guess why Dani put it under web development originally, our current push for tagging rather than categories means that the location becomes less important. Unfortunately, it means that in the interrim there's a bit of confusion.

Member Avatar for Reverend Jim
0
280
Member Avatar for akane.mikazuki

You're thinking about it too hard. Just loop from 1 to 100 and add 10 at every multiple of 10 after updating your sum. for (i = 1; i <= 100; i++) { sum += i; if (i % 10 == 0) { i += 10; } }

Member Avatar for jaduong
0
109
Member Avatar for greg.lafrance.96

Here is the fix: for (i = len - 1; i > m; i--, m++) { I'll leave it to you to figure out why that fixes it, but working through the logic with a small line of text on a piece of paper will help greatly. :)

Member Avatar for TalhaMoazSarwar
0
435
Member Avatar for Ctwo

> if the str were to be an array of two dimensions, eg. str[][] format how would it look like? In a function declaration, only the first dimension size can be omitted. All subsequent dimensions must have a matching size to the array you pass, so it would be something …

Member Avatar for TalhaMoazSarwar
0
200
Member Avatar for saxon84

> DATA[0] = new int[100]; //this works Yup, as it should. > DATA[1] = new int[100][5]; //but this don't Of course it doesn't, because you're initializing an `int*` with an incompatible type. `int[100][5]` is not compatible with `int*`. You could fake it by saying `DATA[1] = new int[100 * 5]` …

Member Avatar for deceptikon
0
3K
Member Avatar for JOSheaIV

It kind of depends on the parts you're finding difficulty with. If you can be more specific, I may be able to offer some advice. Though it's mostly just buckling down and taking more care as you write, which can be beneficial in that it forces you to think more. …

Member Avatar for JOSheaIV
0
149
Member Avatar for reis02

What is this and why do you want it decoded? Against my better judgment I'm giving you the benefit of the doubt rather than closing this thread given your posts thus far.

Member Avatar for almostbob
-3
151
Member Avatar for Hidayat_1

> A language expert Mr. ABC objects the designers of C++ on the bases of following two arguments I suspect this 'language expert' doesn't actually write code. Orthogonality is an important concept in language design, yet even more important is sacrificing orthogonality for usability. It doesn't matter how beautiful a …

Member Avatar for deceptikon
0
167
Member Avatar for biabia1
Member Avatar for happygeek

Dave and I go way back, from cprogramming.com circa 2000 to flashdaddy (now entropysink, IIRC), and Daniweb. The banter and sharing of knowledge was top notch every time. :D I think my fondest memories were the many MSN Messenger chats we had about programming and whatever else came to mind. …

Member Avatar for Dani
0
449
Member Avatar for castajiz_2

> Should I be ashamed of myself Certainly not. I spent a number of years on cprogramming.com before moving to Daniweb. The choice was obvious: cprog had a lot of experts at the time and Daniweb did not, I could offer more by switching. Do what's best for you, my …

Member Avatar for diafol
3
684
Member Avatar for happygeek

How about a retroactive featuring of Dave Sinkula, sort of as a memorial to a good friend and a great member? Obviously there can't be an interview, but I think it would be a nice gesture.

Member Avatar for happygeek
0
448
Member Avatar for Sphinx'LostNose

Typically modern systems will use a cryptographically secure one-way hash to store credentials. Provided the password is strong, coupled with judicious salting, it can be quite difficult to break given only the hash result. Not impossible, mind you, but much more secure than using straight up encryption.

Member Avatar for mike_2000_17
0
281
Member Avatar for Mr.M

The command looks dicey to me. What is 'test'? If it's a variable, the string is constructed incorrectly: "DELETE FROM just WHERE folder = '" & test & "';" If it's a literal value, you need to say as such in the string: "DELETE FROM just WHERE folder = 'test';" …

Member Avatar for Mr.M
0
392
Member Avatar for my822

When a picture box is empty, the Image property is null. I'd wager that however you're saving the data doesn't take into account that the image might be a null object. You can either change how you save the data to account for nulls, or ensure that the picture box …

Member Avatar for deceptikon
0
136
Member Avatar for keshavbhusal1

It's generally frowned upon since reverse engineering has historically been used for black hat purposes. Further, due to some sticky legal restrictions, I can easily see it being troublesome to have a course focus on it.

Member Avatar for mike_2000_17
0
111
Member Avatar for ms95

You need a data structure that can hold anonymous (unnamed) objects of the `struct`. For an unknown number of records, I'd suggest a linked list. Here's something to get you started: #include <stdio.h> #include <stdlib.h> #include <string.h> struct record { char *name; }; struct node { struct record data; struct …

Member Avatar for ms95
0
949
Member Avatar for 00Gambit

The bad news is that if you're not digging it this early, hardcore programming probably isn't for you. Casual programming can remain fun, of course, but any push into serious development or even a career doesn't strike me as promising. The good news is that it can be easy to …

Member Avatar for ~s.o.s~
0
409
Member Avatar for LostnC
Member Avatar for deceptikon
0
3K
Member Avatar for negru

You only update the longest word when it's longer than the current word. If you want the last instance of the longest word when there are multiple instances having the same length, update the longest word when it's equal to or longer: if (strlen(word) >= strlen(max)) { strcpy(max, word); }

Member Avatar for deceptikon
0
10K
Member Avatar for Abners

> because windows operating system get corrupt instantly There seems to be more here than meets the eye. If Windows gets corrupt "instantly", that's suggestive of a deeper problem unrelated to the OS itself.

Member Avatar for techtrendsit
0
322
Member Avatar for brandon66

To answer your immediate question, `printf(" %d",ocean[ROWS][COLS]);` should be `printf(" %d",ocean[r][c]);`. The former is flat out wrong in that officially `oceanOne[10][10]` does not exist. In practice it does for your compiler, but only because that's the memory location for `oceanTwo[0][0]`. That's why the first call gives you random numbers while …

Member Avatar for brandon66
0
199
Member Avatar for ddanbe

Hmm, I'm not sure I see the benefit in this case. Though variations on `ForEach` are relatively common. As an example, I have an extension method for `ForEach` over an `IEnumerable<>` and another that reports progress over iteration: /// <summary> /// Performs an action on each item in an enumerable …

Member Avatar for kplcjl
0
384
Member Avatar for MD. FEEZZS
Member Avatar for erum

It's basically telling you `CustomerTBLs` does not exist under the `dbo` schema. My first step would be to carefully check spelling.

Member Avatar for deceptikon
0
202
Member Avatar for Taz098

It pains me to recommend [WiX](http://wixtoolset.org/), given that the learning curve is so high. However, if you want a free option that's not gimped, I think it's the best one.

Member Avatar for pritaeas
0
115
Member Avatar for Tcll
Member Avatar for SquirrelRemoval

> How much everyone of you has spent on daniweb.com??? I couldn't begin to guess how much time *everyone* collectively has spent. ;D Since 2005 I'd wager my time spent either participating on or developing Daniweb can be measured in man-years. > In your time period what kind of thing …

Member Avatar for deceptikon
0
244
Member Avatar for Faissalelbarhami

> of course i will read both of papers, and obviuosly i will know the diffrence where it is. That's not enough to write a program. You need to break down things such that a stupid literal child (aka. a computer) could go through the steps and accomplish the goal. …

Member Avatar for Faissalelbarhami
0
390
Member Avatar for Xabush

I'm not sure I see the benefit of P2P rather than having a controlling server if you're looking at having secured user access (since you mentioned a password). Sure, you could store an identity account locally and transfer the relevant data to peers on connection acceptance, but that's more of …

Member Avatar for deceptikon
0
139
Member Avatar for ogsirus

> Would that not lead to more calls to the db which will affect performance? This question suggests you're either doing more than you've said with the database, or there are a huge number of records. Somehow I don't see an employee table being quite so large that you cannot …

Member Avatar for deceptikon
0
325
Member Avatar for PulsarScript

InterestRate has a `private` setter, so it's not accessible to callers. AddInterest is a method with no arguments, so the correct call would be: ((DepositAccount)obj[1]).AddInterest(); However, since your interest rate is never modified within the class, you might consider removing the `public` qualifier on the setter.

Member Avatar for PulsarScript
0
144
Member Avatar for Luffy

Since you're working with raw keyboard data, there's more work to be done than simply calling `getch` and printing the mask character. You need to recognize a line feed starter as well as any backspacing. Off the top of my head, something like this: #include <iostream> #include <cstddef> #include <conio.h> …

Member Avatar for deceptikon
0
6K
Member Avatar for loserspearl

[This](http://eternallyconfuzzled.com/tuts/datastructures/jsw_tut_linklist.aspx) tutorial may help.

Member Avatar for Arshad_2
0
117
Member Avatar for Germio_1

The big question is whether you can get into the industry with a completely new application. If other companies are so far entrenched that it would be very difficult to compete, reselling is a good approach. However, as a reseller you'd need to bring something special to the table. Usually …

Member Avatar for deceptikon
0
134
Member Avatar for Ahmad Imran

> Sadly no one could answer this simple question If you already know the answer such that you know it's simple, why not enlighten us and put the Daniweb geniuses to shame?

Member Avatar for deceptikon
0
330
Member Avatar for Narue

> I am not able to flush stdin here,is there a way to flush stdin? The only portable way in C (ie. using the stdio library) is to read characters until a newline or end-of-file is found. Of course, this ends up causing a blocking read if the stream is …

Member Avatar for Smn
18
13K
Member Avatar for PulsarScript

According to the [documentation](http://msdn.microsoft.com/en-us/library/z50k9bft(v=vs.110).aspx), it's the index in the source array at which copying begins. Presumably the underlying question is *why* is that overload being used when the source index is 0? The reason is that values from the source are being appeneded to the destination rather than copying to …

Member Avatar for deceptikon
0
558
Member Avatar for <M/>

> And also, out of curiousity, are we allowed to put .gifs up as our avatars? Provided the GIF is within our size restrictions, you can upload it fine, but if the original is animated the uploaded avatar will not be animated. The reason for this is we do some …

Member Avatar for deceptikon
0
476
Member Avatar for humorousone

Structure it however you want. It takes time and experimentation to find a project structure that works for you though. As an example, I tend to use something like this: /codebase /documentation /libraries /media /output /tools

Member Avatar for deceptikon
0
250
Member Avatar for RobertHDD

The End.