3,183 Posted Topics
Re: I think that's quite enough of the "me too" joke offerings to do it for money. | |
Re: > The exact same way you do there. Wait. You're saying that the syntax and semantics of loops *don't* change from function definition to function definition? That's just crazy talk. ;p | |
Re: What's your definition of "cool"? And why do you want such a program? | |
Re: I'm willing to be that `count` and `totalwords` are both int too, which means your division is performed in integer context. If the division results in a value less than zero, the precision is ignored and the result will be 0. You want something more like this: int wordpercent = … | |
Re: I find it odd that the implementation supports streams yet not completely. If the hardware couldn't handle stream behavior (presumably this is an embedded platform) then excluding that part of the library entirely would be expected. Rather, I don't recall any clauses in the ISO standard that say tellg() may … | |
Re: > Is this true or can I actually do this in C++? One of the reasons why this is reasonable in Java is the lack of default arguments. In C++ you can do it all with one constructor: Rectangle(int width = 0, int height = 0, int x = 0, … | |
Re: The choice and reason are both trivial: pick the language you're most comfortable with, because it's easier to stand up a working project quickly when you're not fighting with your tools. | |
Re: > Clear yet? With one post 2 years ago asking for other people to do their thinking for them, I'm willing to bet that the OP has long since failed. ;) | |
Re: > Plz tell me where i am going wrong.. Start with the fact that you're double incrementing both `ptr` and `i`. Note how the increment clause of the for loop increments both of them, but in all other paths of execution in the body you still increment both of them. … | |
Re: You forgot to give us your teacher's email address so that we can submit your homework after we've done it. :rolleyes: | |
Re: > I am attempting to find a pivot point in a sorted array for example { 1 2 4 5 9 } might become { 5 9 1 2 4 }. That seems simple enough. The array is already sorted, so just start swapping everything from the median: for (int … | |
Re: Have you read the documentation for the XmlDocument class? It has methods for doing everything you want. | |
Encoding and decoding functions for RFC 4648 compliant base-64. The code is written in standard conforming C11 and backward compatible with C99 (pre-C99 is *not* supported without code changes). | |
Re: > The problem is that there are too many open files. That's indicative of a design flaw. You can check the value of FOPEN_MAX (defined in stdio.h), and it's probably rather large for your implementation. If you exceed that value, you probably need to consider why you have so many … | |
Re: The using directive pulls in *every* visible name from the namespace while the namespace qualified name is visible only for that single use of only that name. Obviously if your goal is to avoid naming collisions in multiple namespaces, a using directive is the worst possible choice and a qualified … | |
Re: The download you're looking for is mingw-w64-v2.0.6.tar.gz, [here](http://sourceforge.net/projects/mingw-w64/files/mingw-w64/mingw-w64-release/). It looks like MinGW-64 is distributed as a gzipped tarball and there's not a Windows installer, so you'll need to extract it. I use WinRAR to handle extraction of gzipped tarballs, you may consider that too. Once the package is extracted (note … | |
Re: Unless you're forced by a very backward teaching institution to use Turbo C, or you're maintaining legacy code that *must* be compiled using Turbo C, GCC (a recent version) is very clearly better. | |
Re: The forum you're looking for is called [Computer Science](http://www.daniweb.com/software-development/computer-science/14). | |
![]() | |
Re: For example using [Wikipedia's](http://en.wikipedia.org/wiki/Tree_traversal) traversal result (F, B, A, D, C, E, G, I, H), the execution logic might go like this: F, B, A, D, C, E, G, I, H ^ F, B, A, D, C, E, G, I, H ^ ^ F, B, A, D, C, E, G, … | |
![]() | Re: > but when you come to know that he dont have any worth of you and even laugh when you show respect to them, then that is a pathetic situaion. what about this ? You take it up privately with him instead of [airing your dirty laundry](http://www.usingenglish.com/reference/idioms/air+your+dirty+laundry+in+public.html). And if what … |
Re: The last two loops should be nested: for (int middle = 0; middle < 0.5 * height; middle++) { for (int middle = 0; middle < height - 1; middle++) cout << ' '; cout << '|'<< '|' << endl; } | |
Re: [inheritance](http://dictionary.reference.com/browse/inheritance) (n): 1. something that is or may be inherited; property passing at the owner's death to the heir or those entitled to succeed; legacy. 2. the genetic characters transmitted from parent to offspring, taken collectively. 3. something, as a quality, characteristic, or other immaterial possession, received from progenitors or … | |
Re: Please review the following code and compare with yours. Take note of the comments and try to understand why I made the changes that I made. I tried to keep the spirit of the algorithm the same, even though I'd probably do this differently: #include<stdio.h> #include<string.h> int main(void) { char … | |
Re: > So far I have this, but I think it is wrong because it is giving me syntax errors. That's a reasonable conclusion. ;) What are the syntax errors? | |
![]() | Re: > Do you think they might ask me about active directory and exhange server? You *might* be asked about IIS, but I strongly doubt that a webmaster would be expected to maintain the local network if it's not explicitly stated that you're interviewing for a dual webmaster/sysadmin position. ![]() |
Re: Okay, I'll bite. On the assumption that you won't simply turn in my code as if you wrote it, and because the Vigenere cipher is so shockingly simple, here's some working code: #include <climits> #include <cstdlib> #include <iostream> #include <string> using namespace std; /* @description: Increments value and wraps around … | |
Re: This is a parsing problem, not a simple tokenizing problem. Do you have more details as to the format of the instructions? It looks like you're attempting to write a program that reads assembly-like instructions and break them down into component parts. For that I wouldn't use strtok() as the … | |
Re: http://eternallyconfuzzled.com/arts/jsw_art_bigo.aspx > this is how it is exactly written on the handout There's clearly a typo in the outer loop condition. `i < n - 10` is probably what was intended. | |
Re: > The buttons may only show posts which are currently negative or positive, so if someone voted down and someone else voted up, the net result would not be visible on either button. Yup. The numbers show voting history on your account and the buttons retrieve currently positive or currently … | |
Re: > The first part of that function is used to sort the words gathered in a text file from A to Z, the second part is meant to find any duplicate words Pro tip: If the description of your function includes the word 'also', it should probably be refactored into … | |
Re: Alternatively, and this would be my preferred option, you can use the KeyPress event to disable that key entirely: private void textbox_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar == ''') e.Handled = true; } | |
Re: > Could you please advise if I am doing some thing wrong here? You're doing something wrong by including file1.c in file2.c. Note that Narue was talking about visibility in the *translation unit*, not source files. A translation unit is the resulting intermediate file after the preprocessor has run, which … | |
![]() | Re: We're going to chalk it up as impractical to fix, at least in any automated way. Feel free to report any posts you find to have truly egregious formatting and one of the mods can attempt to fix it. ![]() |
Re: That's not C either, what language are you using? | |
Re: bool? my_var = null; Of if you like being verbose: Nullable<bool> my_var = null; | |
Re: That's not C++, but the algorithm isn't exactly language specific. To simplify things I'd suggest a nested loop: // Check the previous, current, and next row for (int i = row - 1; i <= row + 1; ++i) { // Exclude invalid row indices if (i < 0 || … | |
Re: Keep in mind that you won't be able to perfectly simulate sizeof because it's a compile time operator. But you can get somewhat close for the type syntax with pointer arithmetic: #define SIZEOF(type) (int)((char*)((type*)0) - (char*)((type*)0 + 1)) It's not strictly portable, but I've yet to see a system where … | |
Re: > What else could you need to know? The contents of the file and enough context to test your code, obviously. For example, how have you defined WordStruct? Please compose a small test program that's complete, then post it here along with a sample of the file you're using. Reproduction … | |
Re: > why array size is different inside function solution1? Because the "array" in solution1 isn't an array, it's a pointer. Don't be tricked by the array-like syntax of `int array[]` in a function parameter declaration, it's just syntactic sugar and equivalent to `int *array`. | |
Re: > Purple is for girls. 1. The owner is a girl. 2. Men who say "XYZ is for girls" just need more confidence in their masculinity. ;) | |
Re: > you can use freopen() to read or write data from/into the file Why freopen() specifically? freopen() is actually a fairly rare function to need, usually being the choice for unusual stuff like redirecting standard streams from code or changing the open mode of an existing stream. > But I … | |
Re: > I don't see code here, why is it being detected as such? The detection algorithm presently looks for four spaces, a tab, or curly braces anywhere in the post. | |
Re: Why a text box? That forces you to validate essentially unchecked input. If you don't want to use radio buttons, how about a dropdown menu with M or F? ![]() | |
Re: C has no references, so you'd use a pointer to a pointer. The concept of using a pointer to an object to modify the object can be applied recursively, and the "object" you need to modify can be a pointer. | |
Re: I'll answer your comments directly: > // Should I malloc memory for ptr_ex here before assigning values to it??? Yes. An unintialized pointer is not a pointer to usable memory, you must first point it to memory that you own either through dynamic allocation or through the address of an … | |
Re: http://en.wikipedia.org/wiki/Machine_learning |
The End.