1,359 Posted Topics
Re: First off, we don't do other people's homework for them. Second, we *don't* do other people's homework for them. And third, ***we don't do other people's homework for them***. Sensing a pattern here yet? No one here will simply hand you a solution on a silver platter. If you show … | |
Re: No, the DBMS is the SQL library or process that the application interfaces with to manipulate the database. For example, MySQL is a DBMS, but an application that uses MySQL would not be. | |
Re: Let's see, old style headers with extensions, `<conio.h>`, `void main()` - let me guess, your professor is using Turbo C++ as your compiler? */me checks OP's locations* Ah, Pakistan, that explains that. This comes up a lot, and the answer is that there's nothing to be done about it. Pity, … | |
Re: **Aditya_13**: While your willingness to help is commendable, it is ill-advised in this instance. Why? Because the OP didn't show any evidence that they had put any effort into the project themselves. There is a rule here a Daniweb that querents have to give some indication that they have tried … | |
Re: The elaborate on DaveAmour's answer, you should know that C (the predecessor of C++) does not have a built-in boolean datatype, and until the C99 standard didn't have a standard defined one either. Thus, it has long been the convention in C to use `int` variables as booleans, with 0 … | |
Re: The first step is to import the GUI library you mean to use. Since [a set of bindings for Tk](https://docs.python.org/3/library/tkinter.html) is included with the Python standard library, that's probably the one you'll want to use; let us know if you want a different toolkit such as wxWindows or Qt. Assuming … | |
Re: Can you clarify what you mean, please? Is it that changing the source code leads to it failing to have any output at all, or is it that the output window is closing as soon as you finish the input? I ask this because the latter problem is a known … | |
Re: *I know I've been using this a lot, but the OP in this case [really needs this particular anvil dropped on his head](http://tvtropes.org/pmwiki/pmwiki.php/Main/SomeAnvilsNeedToBeDropped).* First off, we don't do other people's homework for them. Second, we *don't* do other people's homework for them. And third, ***we don't do other people's homework … | |
Re: As Moschops said, the NULL pointer is essentially a marker. Setting a pointer to NULL is a way of indicating the pointer is in an unusable state. Now, as for it's uses, they mostly relate to handling dynamic memory. You generally want to initialize any pointer that you don't have … | |
Re: You're correct that `gotoxy()` is specific to the Borland compilers; there's no standard equivalent for it, exactly, but for this purpose, the code you have is good beginning. I would recommend making a few changes to get it working: void draw_box(int width, char top, char sides, char bottom) { cout … | |
Re: This is all getting very repetitive, in this thread and [others](http://www.daniweb.com/software-development/computer-science/threads/452680/help-porject-topic-needed#post1962794). Can someone make a sticky FAQ with project suggestions? | |
Re: If you don't mind me asking, did your instructor actually teach you to use `goto`, and more importantly, were you actually directed to use it? I would find it deeply concerning if a professor were to even *mention* `goto` in an introductory course. Actually teaching its use is simply unacceptable. … | |
Re: As rubberman said, your statement doesn't make much sense. Could you please explain a little clearer just what it is you need help with? | |
Re: I should also add that, strictly speaking, in C prior to the C99 standard, all declarations within a function needed to be made *before* any other statements. I only bring this up because you `#include <conio.h>`; the console I/O library is *not* a standard part of C, and is associated … | |
Re: If you don't mind me asking, why would you need to, given that Excel can sort a row or column of data with a single push of a button? I don't doubt you need it, I'm just looking for some background on the matter. | |
Re: OK, first off, this code as posted isn't valid; you have the `TestAndTest()` function (which I assume is actually supposed to be `TestAndSet()`, but that's an aside) inside the `main()` function, which is an error (C does not allow for nested functions). I assume it is a quirk of cutting … | |
Re: The problem is quite simple: your indentation is off. Lines 25-65 need to be one level of indent to the right. > Please don't tell me how to shorten it, I want this to be a very understandable (from a very new beginner perspective) program so I want to keep … | |
Re: In C, you cannot directly compare compound structures such as strings the way you can simple values such as `int`s or `double`s; or rather, you can in the case of strings, but you would end up comparing the *memory addresses* where the strings begin rather than the strings themselves. What … | |
Re: While the program looks good functionally, I would like to make some stylistic suggestions. 1. You generally want to separate the functions which operform computation from those which do input and output. This principle of *decoupling* serves to make the program more modular and easier to fix and modify. Separating … | |
Re: Considering that most of the instructors in question also teach C++ as if it were C - using the `stdio` functions instead of `iostream`, not covering classes at all, etc. - I would say this is likely. ![]() | |
Re: Part of the problem lies in trying to write out the `struct`s directly, rather than writing the individual fields out in an system-independent form (a process called *serialization*). A `struct` is not necessarily straight data; there may be padding for architecture-specific memory alignment, for example, and if the `struct` contains … | |
Re: **Darwin_1**: You might want to check the timestamp on the thread; Baudday hasn't been active on Daniweb in three years. Also, it is generally considered bad form to ask for code without showing your own work first. To quote the [Daniweb forum rules](https://www.daniweb.com/community/rules) in this regard: > *Do* provide evidence … | |
Re: There are two really simple approaches you could take: 1. Use two loops, inner and outer, which step through the array. Have a second array hold any duplicate values you find. 2. Sort the array (or a copy of it if you need to preserve the original order), then walk … | |
Re: **rose_2**: While your enthusiasm for answering the question is commendable, it is generally considered a poor practice to provide outright answers to problems when the OP hasn't demonstrated that they had already made a good-faith effort to solve the problem before posting here - it encourages cheating, or at least … | |
Re: I would add that the [Travelling Salesman Problem](https://en.wikipedia.org/wiki/Travelling_salesman_problem) (which this could be, depending on you interpret the traversal requirement) is known to be an NP-Hard problem, so even if you succeed in getting it to work, it may have quite a long run time depending on how many nodes the … | |
Re: Consider a forum meant to assist programmers in learning to program, but whose members are constantly bombarded with requests from students who want their homework done for them with no effort on their own part. Explain why it is counterproductive to both the members and the students for the members … | |
Re: The reason is simple: the variable `sample` is *not* external to the **main.c** file, and in fact is a local variable of the `main()` function itself. When you declared the variable as `extern`, you were telling the linker, "I want to access a variable defined in another object", which isn't … | |
Re: Interestingly, either you or a classmate of yours posted [essentially the same issue](https://www.daniweb.com/software-development/cpp/threads/493689/high-fashion-department-store) some four days ago, under a different username. You might want to view the answers given at that time. Given what you are saying, I gather that most of the code was given to you by the … | |
Re: > write a program for left recursion? Setting aside the fact that you are asking us to do your work for you, which is against the general policy of Daniweb, this sentence (fragment) doesn't make much sense. I assume what you meant was that you need to write a parser … | |
Re: What program? I see no code posted here. As we've already said, you need to demonstrate that you have made an attempt in earnest to solve to assignment, *and* post useful information about the problems you are experiencing and pose meaningful questions about the issues you are experiencing. ***We will … | |
Re: *Once more with my standard reply for this sort of thing:* First off, we don't do other people's homework for them. Second, we *don't* do other people's homework for them. And third, ***we don't do other people's homework for them***. Sensing a pattern here yet? No one here will simply … | |
Re: The error is a very simple one: you misspelled the header name in your program source file. Just change the 'g' to an 'e' and it should go through correctly. BTW, I would do four other things. First, I would remove the `using namespace std;` from the header file, and … | |
Re: The reason it isn't printing the rest of the list is because... you don't have it printing the rest of the list. Try the following: void printBackwards(ListNodePtr currentPtr) { // if list is empty if(currentPtr==NULL) { puts("List is empty.\n"); return; } // end if else if ( currentPtr->nextPtr != NULL … | |
Re: Just a quick guess, but on line 59, I think you want to change MOV CL,INSTR1+1 to LEA CL,INSTR1+1 | |
Re: **soe win**: You may want to read [this blog post](http://www.peter-urda.com/2010/09/solution-folders-in-visual-studio-2010-explained) if you aren't clear about what the Solution folder is and how to work with it. While the post covers an earlier version of Visual Studio, the principles have not changed much. | |
Re: Let's start by getting this code into some semblance of consistent indentation: #include<iostream> using namespace std; class product { private: int code; char name[20]; double price; int instock; double soldperyear[12]; public: product(int,char[],double,int); void setproduct(int c , char n[],double p,int i) { setcode(c); setname(n); setprice(p); setinstock(i); } void peryear(int i) { … | |
Re: */me dusts off the boilerplate response for this sort of thing... again:* First off, we don't do other people's homework for them. Second, we *don't* do other people's homework for them. And third, ***we don't do other people's homework for them***. Sensing a pattern here yet? No one here will … | |
Re: **Sandro_1**: If you don't mind me asking, what is it you are trying to accomplish? I'd guess you were calculating the median of the data set, but you didn't specify that the `ArrayList` was sorted; if it isn't, then it is hard to see what you would be getting from … | |
Re: As Moschops said, te stream insertion and extraction operators are usually implemented as free functions that is are `friend`s of the class, rather than as members, but it would be useful to understand *why* this is the case. The reason you can't have it as a member operator is because … | |
Re: > lol guys i told u i need help in the main at > Using the two objects, pointer and reference test all the member functions of your class Actually, you didn't; you simply copied the assignment statement with no information of where you needed help. In any case, you'll … | |
Re: **miazara**: I see that you tried to reply to DaveAmour and rubberman, but you entered the code into the comments, which is too short for such purposes. You need to use the Reply box at the bottom of the page to send a full length reply. | |
Re: Wouldn't make sense to have the class implement `Serializable` rather than hard-coding the file output? I haven't used Java serialization before, so I don't know the limitations and weaknesses of it, but I would expect that using that would save a good deal of effort and make the code less … | |
Re: First off, as I have said elsewhere, in C++ `main()` should always have a return type of `int`. Some older compilers allowed `void main()`, but it is actually not permissible under the standard. It should return zero for a successful program run or an error code on failure. Second, the … | |
Re: Given that zrd0808 hasn't been on Dnaiweb in four years, I doubt you'll get an answer :-) | |
Re: It's quite simple: replace the trailing space, `' '`, with `endl` (the end of line marker for ostreams). BTW, you can always use `endl` instead of `'\n'` in C++ stream output, the only difference is that `endl` (IIRC) also flushes the stream (that is, it forces it to go to … | |
Re: Sadly, my earlier recommendation *is* as kind a response as I can make; it really is terrible for any professor to be forcing their students to use something as long outdated as Turbo C++, and students shouldn't put up with it. However, seeing how you are stuck in this position, … | |
Re: The issue is not between arrays and other variables in general, but arrays and *pointers* to said arrays. An array is not a pointer; it is a regular variable, just one which names a block of values rather than a single value. The usual syntax for accessing the elements of … | |
Re: All well and good, and of some definite interest in general, but... why post this here, except as a way of advertising your blog and thesis? This forum is mostly for assisting others in finding solutions to problems; your neither ask a question nor (within the post) provide an answer. … | |
Re: Well, to begin with, this is a C++ program, not a C program, and a poorly written one at that. The header formats indicate that it probably dates back to the late 1990s, when the then-new C++ standard was still being formalized - either that, or the programmer didn't understand … | |
Re: While you aren't showing it, I assume you are closing the `#ifndef` at the end of the file. As for why it isn't finding the `std::string` class, I'm not sure. While I do see something that ought to be a showstopper - the C library headers `<time.h>` and `stdlib.h>` should … |
The End.