3,183 Posted Topics
Re: Step back a moment and consider *why* you need `clrscr` or any variations. It's my fairly strong belief that when you start needing to do any non-linear manipulation of the console, you should probably bite the bullet and move to a GUI. That said, if you're on a Windows system … | |
Re: At that granularity, everything is efficient. However, tricks for swapping without a temporary variable have a higher chance of *not* being as efficient due to potentially confusing the compiler's optimizer. The lesson to be learned is that it's not worth trying to optimize a few bytes from a single scalar … | |
![]() | Re: Signatures are text only. Feel free to use the link though. ![]() |
Re: You can get a list of processes and parse the result, but it's highly OS dependent. | |
Re: The code will compile, but the subscript operator for `std::vector` does *not* throw an exception. To get an out of range exception you must use the `at` member function. | |
Re: WCF is really just a more powerful sibling of web services. HTTP is the transport protocol of the web, and SOAP is a messaging protocol for packaging data. Serialization takes raw data and converts it to a convenient storage or transport mechanism like binary or XML. | |
Re: > I know that having the same person appear in the same table more than once is troublesome. Basically you've described the difference between a normalized and denormalized database. A normalized database stores the actual data in a single table and uses referential links (such as primary keys) to share … | |
Re: It's a little tricky because integers can be represented with multiple characters. Unless you only need a single digit, how do you plan to signal the end of the integer using raw input? | |
Re: Not enough information. Please show us how you're defining and populating your string. | |
Re: The way you've indented your code suggests the error. If nextRow++ needs to be inside the inner loop, the loop body must be surrounded with braces: for (col = 0; col < NUM_FOUR; col++) { matrix[(nextRow)][col] = matrix[(row)][col] * 3; nextRow++; } | |
Re: Close. There's a Rows property that represents a collection. Unfortunately, `DataTable`s are somewhat awkward to work with. | |
Re: You can pull everything with a single cin call, provided the two items are separated by whitespace during input: cin >> a >> b; Adjust your prompts to that and it'll be closer to what you want. However, if you want free form control over the console, you'd be better … | |
Re: This seems like it may be better suited to a server cron job, since I'm assuming it depends on the date of the file's creation relative to the current date. You'd want some schedule task that runs daily. | |
Re: How are you creating the database? Libraries such as the Entity Framework can create the database for you, and deployment is trivial given the correct connections and permissions into SQL. If the database was created manually, you need to recreate it manually, provide SQL scripts that recreate it, or include … | |
Re: > So... what are your favorite workouts? That's a slippery slope if you ask the right person. My favorite workout is a 4 day upper/lower body split: Monday: Lower Tuesday: Upper Wednesday: Rest Thursday: Upper Friday: Lower Weekend: Rest The individual exercises vary, but my days are broken down into … ![]() | |
Re: I'm unable to reproduce the vaguely stated problem on Opera. Can you provide precise reproduction steps? | |
Re: > root posseses some junk value.. Just a correction, but since `root` is a global variable, it's properly initialized to 0 (ie. a null pointer). It doesn't contain a junk value, though line 41 is indeed erroneous; it should be pushing `temp` rather than `root`. | |
Re: > Should I go for a degree in Computer Science, or are there other educational paths I should take? Since you're already in the field and have experience, I wouldn't waste my money on a degree. You could buy a CS textbook or two and be just as well off, … | |
Re: What kind of variables? Are we talking just scalar values or data structures? The former are easy to export, but the latter could take a little thinking to get a format that's easy to both export and subsequently import. | |
Re: How are you building the files together into an executable? The code looks fine, but the errors suggests that main.cpp and definition.cpp aren't linked together. | |
Re: > What will be c++ equivalent of this snippet? There would be no differences (barring the obvious syntax errors, but that would be broken in both languages). The FILE structure is a standard type inherited from C. > Also, is this struct correct for c++? Yes. | |
Re: > How can I convince my boss that having me travel for extending amount of time to visit clients or prospects is not the most productive use of my time. I'm not entirely sure that's the case, to be honest. At a small company you must wear many hats, simply … | |
Re: I may rewrite a number of my tutorials and close down my site if Daniweb's interface is suitable for...shall we say, somewhat longer tuts with plenty of awesome code? ;) I don't think I've seen any really long ones yet. | |
Re: Yes, someone can assist. But nobody will do it for you. Please point out what difficulties you're having so that it doesn't sound like you want your homework done for you. | |
Re: > why the 'PRO's' want avoid the "\n"? It's the opposite. You should avoid `endl` unless you know that the stream needs to be flushed afterward. Otherwise you should prefer `'\n'`. `endl` is implemented like this: inline ostream& endl(ostream& out) { out.put(out.widen('\n')); out.flush(); return out; } There's always an implicit … | |
Re: Please ask a specific question. Simply posting your homework requirements suggests you want someone to do the work for you. | |
Re: > Albeit not the most straight forward way :( Our mark read algorithm was probably one of the most obtuse in the entire code base (excepting the editor parser which neither of us wrote). I don't imagine *any* solution would be straightforward. ;) | |
Re: Can you be more specific about what you can't complete? It's somewhat unreasonable to expect us to review your code and figure out what's missing from a brief description of the requirements. | |
Re: You should be able to reference the file with a UNC path. | |
| |
Re: Do you want the open mode that was passed to the constructor or open member function? Or do you want to know dynamically whether the last operation was a read or a write? Ultimately, you'd need to maintain a flag providing this information, which could be stored in the `fstream` … | |
![]() | Re: Yes, of course there's a way to do that. It's pretty straightforward in that you open the file and then read or write the data. However, it does depend somewhat on the format you want for the file. ![]() |
Re: > But as i am returning a pointer s I can't free it before returning it. The caller has to free it. While the ideal for robustness is to have memory allocated and freed at the same execution level, that's not always practical. > I take a char array[100],Perform operation … | |
Re: I don't remember off the top of my head, but it's not more than 10. You should be able to add a signature now from [here](http://www.daniweb.com/members/edit_profile). | |
Re: For what purpose? This seems pretty sketchy. | |
Re: > However, the values for INT_MIN and INT_MAX are shown in the appendices as being the same as SHRT_MIN and SHRT_MAX repsectively. The *minimum* range of int is indeed 16 bits, even though you're unlikely to see less than 32 bits on a modern implementation. > I was hoping that … | |
Re: Your code is horribly broken. I'm guessing you meant to post the errors you're getting and ask what's causing them, as per [this helpful guide](http://www.catb.org/esr/faqs/smart-questions.html). | |
Re: > Im trying to accomplish to save both aco####s and settings into the same xml like so Then if you want to continue using `XmlSerializer`, you should wrap those two classes in a another class, then serialize *that* one: class AppSettings { public General GeneralSettings { get; set; } public … | |
Re: > 1 - why some C++ PRO don't advice me use these code?(making properties) Because it's awkward (as you've discovered), unnecessary, and a complete solution isn't as good as what you'd get with another language like C#. C++ "pros" do without excessively awkward fluff. | |
Re: I think WYSIWYG is ideal for the display aspects of web development (HTML and CSS, specifically), and in the next 10 years the tools will hopefully be good enough that we don't *need* to drop down to the code to do what we want. As it is, drag-drop-configure gets you … | |
Re: > My question is how does the first example work since i haven't used the .Dispose() method How would that stop the code from working? You've merely failed to release resources, which depending on the resource involved may or may not cause issues down the line. > I m just … | |
Re: You're returning a reference to a local variable. The local variable gets destroyed, so the reference is dangling. Just return a reference to `myStore[row]` directly: template<class V, class I> V& Matrix<V,I>::operator()(int row, int column) { return myStore[row][column]; } Alternatively you can make a local *reference* to the row, then return … | |
Re: Please read our rules concerning homework. We don't just give away code for homework problems without proof of effort, and even then most of us won't write the whole thing for you, we'll just push you in the right direction. | |
Re: > using this code its only print success.. That's the point of the program, to tell you whether the file was opened successfully. > i want to display file in notepad.. Please note that we're not going to write your program for you. You asked a specific question and got … | |
Re: Is the array holding the string large enough for another character? Because if so it's a simple matter of: s[size] = c; // Overwite the nul with a new character s[++size] = '\0'; // Terminate the string after the new character | |
Re: > i have 1 question: for use dynamic arrays, can i use normal variables instead pointers? Pointers *are* normal variables. But when it comes to "dynamic" arrays, it's a bit of a misnomer because you're not creating an array, you're simulating one with dynamic memory allocation. Really the best you … | |
Re: > that's why someone tell me for learn C# lol C# has its own quirks that complicate the learning curve, so don't expect any magic by learning a different language. ;) | |
Re: The headers themselves don't *do* anything, they just provide declarations so that code will compile. You also need the underlying libraries, which if they aren't already provided by the implementation, most likely won't transfer easily. Your best approach would be to determine which functions you're using and then look for … |
The End.