3,183 Posted Topics

Member Avatar for Aeonix

Yep, that looks like a bug in the Markdown processing to me. Markdown can be a little tricky when it comes to lists and code blocks. In this case, you can double tab the code to nest it underneath the third list item and the block is formatted correctly, or …

Member Avatar for Dani
0
301
Member Avatar for K. Chris

We're clearly the devil's spawn, being all objective and fair. ;) I'd wager this complaint has something to do with not being able to differentiate between enforcing the rules as a moderator and participating in discussions as a member.

Member Avatar for Reverend Jim
-1
629
Member Avatar for Kenneth_3
Member Avatar for rubberman
0
144
Member Avatar for Hector_2

> Quicksort is implemented in C with the qsort() function. The interesting thing is the C standard doesn't in any way require that `qsort` be implemented as quicksort, nor does it impose any performance requirements in the same way that C++'s `sort` function does. The C++ standard retains this lack …

Member Avatar for rubberman
0
423
Member Avatar for vjcagay

> For me theres really only one language that can truely be classed as an omnipotent language for all types of program. Machine code. Its slow to learn but once you have a good set of documented building blocks the rest is easy to adapt to fit whatever use you …

Member Avatar for vegaseat
-1
4K
Member Avatar for ram619

> `void print_all(int [][][],int,int,int);` All but the first dimension requires a size. > `print_all(arr[][2][3],degree,row,col);` No indexing is required here, just use `arr` as the argument.

Member Avatar for ram619
0
217
Member Avatar for Thomas_25

> char names[100]; - its just a character array which can hold 99 characters and the last one will be '/0' Yup. > char \*names[100]; - All the 100 array elements are character pointers and are pointing to the starting element of 100 names somewhere in the memory location. Close. …

Member Avatar for deceptikon
0
279
Member Avatar for Warrens80

> Just got a jab in my gum to numb it, and the dentist yanked it out. I had to go down and have all four cut out since they were all impacted. Recovery wasn't that bad though. I've had worse surgeries.

Member Avatar for webecedarian
0
223
Member Avatar for A. Gregory

> Not all compilers are so compliant... That sounds reasonable on the surface, but has an undertone of irrationality if you think about it. Where do you draw the line for features that are hard requirements in a conforming compiler? If the bar is as low as this, it can …

Member Avatar for David W
0
181
Member Avatar for Bartosz

First and foremost, the `argv` array always ends with a null pointer, so there's a possibility that either `argv[1]` won't exist, or it's `NULL`. You really need to check `argc` and act accordingly: if (argc > 1) { // argv[0] and argv[1] are safe to reference } Second, `malloc(strlen(argv[1]))` has …

Member Avatar for Bartosz
0
3K
Member Avatar for Papa_Don

> Is this issued happening because I have "fileName" still open as "objReader"? Yes. > If this is the case, is there a way to close it while still in my loop? Well, you could dispose of the reader and break out of the loop, but that's very ugly and …

Member Avatar for Papa_Don
0
1K
Member Avatar for danielg55

> And i don´t know why the program returns can't open file. `fopen` sets `errno` on failure, which you can query to find out why. The easiest way here would be to interpret the error code using `strerror`: if(!(fd = fopen(buf, "r"))) { printf("can't open file `%s`: %s\n", buf, strerror(errno)); …

Member Avatar for rubberman
0
100
Member Avatar for Habib_7

> word= (char *)malloc(sizeof(char)*100); `word` is a completely separate and independent entity from `words[i]`. Essentially what you're doing here is creating a new pointer, allocating memory to it, then throwing it away (along with losing your only reference to the allocated memory). > words[i] = (char *)malloc(sizeof(char)* 100); Here you're …

Member Avatar for David W
0
334
Member Avatar for kearradcrs

Why are you confused? What have you done? What have you considered? What are you having problems with? Did you try anything before running for help? Simply posting your homework problem with no other substance is not only frowned upon here, it's actually against Daniweb rules.

Member Avatar for David W
0
195
Member Avatar for markdean1989

> If that helps. Not really. What *would* help is paring down your code to the absolute minimum without eliminating the error and posting it here so we can see what's going down. Typically that error occurs when you have a syntax error somewhere above the line that's reporting it.

Member Avatar for deceptikon
0
378
Member Avatar for markdean1989

> Why is this so? `rand` is always seeded with 1 by default, so unless you change the seed with `srand`, the sequence will be consistent.

Member Avatar for rubberman
0
637
Member Avatar for J.C. SolvoTerra

A loop is simple enough, but you can LINQize it fairly easily: var everyNth = src.Where((x, i) => i % n == 0); That gives you the elements, and copying them to another array is trivial.

Member Avatar for overwraith
0
2K
Member Avatar for AmrMohammed

> So yes, you can determine what the original source code looks like if there is no obfuscation/cryption. For .NET to a certain extent. It won't match the original source since higher level constructs are represented internally with lower level constructs, but you can get close enough to have a …

Member Avatar for Suzie999
0
191
Member Avatar for sham

> Ok lets make this more hypothetical, if you completely redesigned a computer and re-wrote the entire operating system could you have a computer that doesn't need ram. From my understanding ram is the middle man, you transfer data from your hard drive to your ram and then to your …

Member Avatar for RikTelner
-1
2K
Member Avatar for Learner010

Nice. You might also consider including `goto`-based equivalents for each loop to really nail down the underlying logic.

Member Avatar for Markland
7
707
Member Avatar for Abdul_32

> `total += float read_input( a,b , c ,d,e );` The syntax is wrong for this line. First, the `float` keyword is unnecessary (perhaps you meant it to be a cast?). Second, `read_input` does not accept any parameters, so the arguments are also not needed. Try this instead: total += …

Member Avatar for deceptikon
0
2K
Member Avatar for vjkmr
Member Avatar for deceptikon
0
94
Member Avatar for happygeek

> So are you one of the 11 million and will you still be on July 15th? In my experience working with a number of companies as customers, Server 2003 has almost entirely been replaced with Server 2008 R2. I can only think of two customers that still have an …

Member Avatar for Slavi
2
583
Member Avatar for rubberman

As a senior systems engineer for a tier-one world-wide engineering company, you must be familiar with the mutually exclusive goals of getting things perfect and meeting deadlines. There was *immense* pressure to get this system rolling before a hard and somewhat unreasonable deadline, and we'll be working equally hard to …

Member Avatar for Warrens80
0
275
Member Avatar for JerrimePatient

> In this case the first is more readable and easier to code right? If all you need is read-only context, sure. Two cases where it's not easier is when you want to index of the enumerated item and when you want to replace the enumerated item. A `foreach` loop …

Member Avatar for deceptikon
0
374
Member Avatar for J.C. SolvoTerra

At the very bottom of every page are lists of links, which include the article workshop that's filtered based on your user permissions.

Member Avatar for J.C. SolvoTerra
0
352
Member Avatar for kamibwp786

> when one left side and one right side child complete then system credit 700 to parent id I don't understand your question. Do you mean when a node has two children, 700 is added to a value in the node?

Member Avatar for kamibwp786
0
729
Member Avatar for Thomas_25

> Linked lists are elegant, but inefficient to keep sorted. Not if you use a hybrid tree/list, hash/list or a skiplist. :D But those implementations aren't as blindingly simple as a regular linked list, so you don't see them often. Data structures are an exercise in trade-offs. You can have …

Member Avatar for rubberman
0
2K
Member Avatar for Papa_Don

You can't (easily) delete the file while it's locked for reading, so I'd alter the logic so that you break out of the reading loop, destroy the reader object, *then* delete the file safely.

Member Avatar for Papa_Don
0
1K
Member Avatar for HōñËy
Re: C++

You won't find it here, Daniweb is not a homework service. We'll be happy to help you with specific problems in *your* code, but we won't do your work for you.

Member Avatar for David W
0
283
Member Avatar for SUBHENDU_1

> PLEASE HELP AS SOON AS POSSIBLE. Please read our [rules](https://www.daniweb.com/community/rules) as soon as possible. Thanks.

Member Avatar for David W
0
179
Member Avatar for sahar.97

You have an array of pointers to random memory, not an array of pointers to infinite memory usable by your program. This code practically begs for segmentation faults due to trashing memory. You need to either specify a size for your strings: char bookName[N][50] = {0}; for (size_t i = …

Member Avatar for sahar.97
0
384
Member Avatar for deceptikon

Howdy all. I've recently been considering doing an online meeting or webcast on certain subjects for which I have a lot of experience or knowledge. The idea being that something too long or complex for a Daniweb article can be more easily shown by sharing my desktop and talking about …

Member Avatar for deceptikon
3
176
Member Avatar for Emma Etigu

There's no requirement that a DataGridView be initialized in the form Load event. Obviously you need to do it *somewhere*, but where kind of depends on the design of your application. Ideally it would happen in one of two places: 1. Immediately before the user needs to see that information …

Member Avatar for altjen
0
1K
Member Avatar for Khalil_2

> thanks guys u lost the chalnge Believe it or not, we can tell the difference between a legitimate challenge, and a lazy student trying to trick others into doing their homework. Your 'challenge' is clearly the latter. > c u in a next question I hope not, we already …

Member Avatar for Schol-R-LEA
-1
258
Member Avatar for Ma Nicole Ydralyn

`gotoxy` let's you move unconditionally, but with standard output you need to print whitespace: #include <iomanip> #include <iostream> #include <string> using namespace std; int main() { int n = 15; cout << setfill('*') << setw(n + 1) << "\n"; for (int i = 0; i < n - 2; i++) …

Member Avatar for vegaseat
0
165
Member Avatar for ddanbe

I'm a little biased as this kind of thing is something I use liberally to avoid duplication, but it's also a good practice in general. One thing to note though is performance. Refactoring into methods and lambdas does tend to introduce overhead, and you should take that into consideration for …

Member Avatar for ddanbe
0
367
Member Avatar for overwraith
Member Avatar for sepp2k
2
239
Member Avatar for diafol
Member Avatar for DaveAmour

> insead of talking, Dani should sit and rewrite it That's not how professional software development works. First the requested feature is discussed for viability: * Is this feature necessary? * Is there an acceptable workaround? * Does the feature fit within the intended design? If it's determined that the …

Member Avatar for diafol
0
1K
Member Avatar for DaveAmour

Laziness is certainly an issue, and sadly there's nothing we can really do about it without instating draconian policies. Another common reason for vague or poorly worded questions is non-native English speakers having trouble formulating their thoughts. The former is obvious, and with a little practice the latter is as …

Member Avatar for ddanbe
0
127
Member Avatar for Mayukh_1

Your pointer is null. Any attempt to dereference it invokes undefined behavior. The second snippet running okay is merely bad luck because it suggests that the code isn't glaringly broken.

Member Avatar for deceptikon
0
155
Member Avatar for Ma Nicole Ydralyn

> he told me that most of the good programs does not use goto statement That's not necessarily true. There's a lot of (well deserved) hate for `goto`, but it's not inherently broken or bad. The problem is that a *lot* of poorly written code has abused it in the …

Member Avatar for deceptikon
0
392
Member Avatar for rola theo

> Congratulations! You're no longer a DaniWeb newbie.<br /> <br /> Why do people feel the need to post the contents of this notification? I'm genuinely curious.

Member Avatar for rola theo
0
2K
Member Avatar for Ma Nicole Ydralyn

I see two problems immediately: char* names; This represents an uninitialized pointer, not a pointer to infinite available character slots as you're using it. I'd strongly recommend using the `std::string` class instead. Otherwise you'll need to dynamically allocate memory to that pointer manually for each instance of the structure. for(int …

Member Avatar for Ma Nicole Ydralyn
0
161
Member Avatar for masterinex

> the console I/O library is not a standard part of C, and is associated with older (that is, pre-C99) Borland compilers. Some common modern compilers support it. I don't see any clear indication that this is a pre-C99 compiler, though use of `fflush(stdin)` narrows things down a bit as …

Member Avatar for deceptikon
0
450
Member Avatar for J.C. SolvoTerra

> My main focus of this question is the use of objects within Interfaces, is this common practice, or even acceptable? Your interfaces contain properties rather than objects, which is just fine and quite common. My issue with the code is twofold: 1. It's overly complicated for what seems to …

Member Avatar for DaveAmour
0
273
Member Avatar for Ma Nicole Ydralyn

Yes, of course. But for homework questions we require some substantial proof of effort on your part.

Member Avatar for Ma Nicole Ydralyn
0
101
Member Avatar for ddanbe

> Tried different things myself, but as I'm a still a learner and could find nothing useful on the web, I'm a bit stuck. It may help your search to know that what you're looking for is called return type covariance. To simplify your search drastically, C# doesn't support it …

Member Avatar for DaveAmour
0
304
Member Avatar for Sadiiiiiiiiee_1

There's insufficient information. Please post the relevant code, the relevant part of the file if you're using one, and the exact error as Visual Studio reports it.

Member Avatar for deceptikon
0
34

The End.