3,183 Posted Topics
Re: > Keep in mind that linked-lists are theoretically nice and make for good prorgramming exercises in computer science classes, but they are far from being all that useful in practice. All these fancy data structures, and the go-to data structure is nearly always an array. That's one of those nasty … | |
Re: Though if you search through the feedback threads, I posted the complete list of automatic titles (as it was then) not long after we went live with the new system last March. I'm reasonably sure it hasn't changed. | |
Re: > For instance, is toupper() and tolower() supported in C99? Yes. > Does anyone know where a reliable reference for stuff like this? What better reference than [the standard itself](http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1124.pdf)? :D It's the draft standard, but the difference between the final draft and the official standard is really just minor … | |
Re: Can you provide any more details? Or were you actually expecting useful help from that vague description? | |
![]() | Re: draw() looks like an event handler. What object and event is it attached to? Since it only accepts EventArgs, you don't have access to a Graphics property. So unless your event handler is malformed and should be taking something like a PaintEventArgs, you'll need to grab the Graphics object from … ![]() |
Re: There's no use in web.config, that setting is for Windows Forms rather than ASP.NET. | |
Re: It's usually recommended that people start with [Beej's Guide to Network Programming](http://beej.us/guide/bgnet/). | |
Re: > i.e.,if it was 0 and person downvoted and then undo downvoted then net vote recied for a post is showing 0 that is correct but the post is displayed in down voted section. I'm not sure I understand the problem. Are you seeing a post with 0 in your … | |
Re: > Is there any chance that a set of rules could be implemented to prevent abuse of the endorsement system? Given that you can only endorse once per account per favorite forum, it's pretty tedious to abuse the system. You could certainly call all of your friends who have an … | |
Re: Why would you want to *increase* the size? | |
Re: It's a little sneaky, but you could pipe an answer to xcopy. It doesn't suppress the prompt, but it does execute it automatically: echo F | xcopy /s /i /q /y src dst | |
Re: > The answer to this is that comments are replaced by preprocessor into white spaces before the macros are even seen!! That's correct. It's not the macro itself that's wrong, it's how you were using it on the assumption that it would start a comment. For example: #include <stdio.h> #define … | |
Re: > `fscanf(filePointer, "%[^\n]", myCharArray)` As an aside, this is no better than gets(). you can fix it by providing a field width though: char myCharArray[100]; fscanf(filePointer, "%99[^\n]", myCharArray); This ensures that fscanf() will never write more characters than the array can hold (99 "real" characters, plus a null character at … | |
Re: Overflowing signed data types, **while technically undefined behavior**, nearly always manifests as wrapping around. So if you have the largest possible value and add 1 to it, the result will (typically) be the smallest possible value. | |
Re: My first approach would probably be to check the parent process and kill the program if the parent is a shell, like bash or csh. | |
Re: > As the titles says I wanna know what are versions of C++ other than Standard C++ and what are the differents between those version if any! Every compiler offers extensions to both the language and the library, but you can generally say that the different "standards" of C++ are … | |
Re: Just because you have Turbo C doesn't mean you *have* to use stupid Turbo Cisms. Anyway, the C library already provides everything you need, most notably qsort() for sorting arrays. On the assumption that the examples you provided are what you really want (with digits always being last), and that … | |
Re: Let me know if it happens again and you're absolutely sure you didn't accidentally bump the button twice. | |
Re: You could take the easy way out and use a loop to handle removing the blanks, though I suspect your assignment wants recursion to handle everything: void compact(char *s) { if (!s[0] || !s[1]) { // Fewer than 2 characters left in the string return; } if (isspace(s[0]) && isspace(s[1])) … | |
Re: > It is using little endian notation but I can't understand how the C compiler knows the endianness beforehand. The compiler is written for a specific platform, and the platform's endianness is well known. | |
Re: Both answers, while correct, may be ignoring a stumbling block: a sentence is not the same thing as a string. What if the string contains a paragraph? How would you get the size of each sentence? That may be what the question is, and it's a little harder than just … | |
Re: > could you help clean it up some? At a glance, I don't see anything too terrible. You seem to be mixing up an explicit declarative and automated declarative style by declaring some variables but not others, but in short pseudocode that's not a huge deal. | |
Re: If you're expecting methods in the class to work together within the timeout period then you can use one object, but be prepared to reopen it as necessary. The problem is that the timeout defaults to 15 seconds, so it's not like you can open a connection in the constructor … | |
Re: Your do..while condition is self defeating. Try using `&&` instead of `||`. | |
Re: > Mine is called "CLOCKS_PER_SEC". That name changes from compiler to compiler. `CLOCKS_PER_SEC` is the standard macro. Any compiler claiming to implement standard C must define it. Any other macro for a similar value is not standard. Here's the same technique wrapped up in an opaque library. First, the header: … | |
Re: Let's start with the easy one. Your extended properties represent an embedded string and should be quoted: "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=D:\20130305.xlsx; Extended Properties=""Excel 14.0;HDR=YES""" | |
![]() | Re: You select the framework version in your project properties. But if you use an installer then it will be able to point out missing prerequisites, which include the framework version. I get the impression that you're just copying the executable around. |
Re: It's hard to say without knowing the purpose of the Screen class. What is a "screen" in this context? The call to the constructor suggests one of two things: 1. The Screen object will take ownership of a pointer to the registers created by the caller: Screen::Screen(Register* registers, int numRegisters) … | |
Re: So what's the problem? The connection string will contain the name of the machine hosting the database, and if all machines are on the same network, it's no different than connecting to a local database. | |
Re: > Is that possible to write a program to burn a computer literally? > A VGA,HDD Not really. Hardware is pretty robust these days. A combination of hardware countermeasures (such as shutting down when overheating) combined with intelligent drivers will do a good job of stopping you from doing something … | |
![]() | Re: There are many ways to do something, and I've always found the four line approach to removing a newline to be excessively verbose. As such, my favorite method of removing a newline is this: #include <stdio.h> #include <string.h> int main(void) { char buf[BUFSIZ]; while (fgets(buf, sizeof buf, stdin)) { buf[strcspn(buf, … ![]() |
Re: This is highly platform dependent. What OS are you targeting? | |
Re: > The atoi() function will convert a char\* into the int that it represents. Unless it doesn't represent an int, in which case you'll invoke undefined behavior. Please forget that atoi() exists, it's totally pointless because you're forced to validate the string before passing it. The safer alternative, [strtol()](http://www.cplusplus.com/reference/cstdlib/strtol/), does … | |
Re: What kind of help are you expecting? As mentioned, we're not going to solve the problem for your or write the code for you. If you ask specific questions you'll get specific answers, but if you ask for "help" and just post an assignment you'll get no help at all. | |
Re: The compiler can do whatever it wants. Given that at least two overloads of main() are required by the language definition, the compiler simply has to conform to that even though it doesn't need to support a general function overloading mechanism. | |
Re: No, it's not working properly because it won't compile. Two immediate problems are <conio> and <stdlib> are not a valid headers *in any era of C++*, and you don't qualify for the std namespace when using <iostream>. I can't think of a compiler that would accept this code, so I … | |
Re: > Nonetheless, you shoud add cast to char* at lines 31 and 70 because malloc() and realloc() return argument are of type void*. C supports implicit conversion both to and *from* void\*. Best practice in C is not to cast, because the cast can hide a legitimate and common error … | |
Re: > `feof(stdin)` can be used to check if the input was read from the file or keyboard. No, not really. It's not uncommon to signal end-of-file from the keyboard. For example, run the following program and watch it print "Yes" when you signal end-of-file using ctrl+z (Windows) or ctrl+d (POSIX): … | |
Re: > All of you includes are depreciated. Deprecated, not depreciated. Also, since <iostream.h> and <conio.h> were never standard in the first place, they cannot be deprecated. They're just non-standard. | |
Re: The error tells you what line it happens on, so take a look at that code, the contents of the assertion, and correct the bug. You didn't include any useful information, so I can't help more than that. | |
Re: What kind of barcode? Are you working with an image or text? Are you actually creating a barcode or reading one? Your question is incredibly vague. | |
Re: I'll be committing a fix for this display bug shortly. Pending Dani's approval it should be resolved in the next push to production. | |
Re: Does the device already have a driver or is he expected to write one? | |
Re: I assume by "booming" you mean popularity. In what context are we talking about? There are a lot of different places programming languages are used in very different ways, and a number of variables could affect which language is "booming" in a certain area and for certain people. | |
Re: > `noOfRows = da.Fill(ds, "tblCustomers");` > No value given for one or more required parameters. [Documentation](http://msdn.microsoft.com/en-us/library/system.data.common.dataadapter.fill.aspx) is amazing. There's no overload that takes just a DataSet and a string. | |
Re: I'm hesitant to help you now that I know your intention for learning assembly is hacking. | |
Re: Well, for starters I wouldn't use the TextChanged event because that would result in a lot of hits on the database for intermediate text. For example, if the user types "foobar", you'd go back and do a fuzzy lookup on the database *six times* when you really only wanted *one* … |
The End.