15 Archived Topics
Remove Filter too many new and intermediate users of C attempt to use the command [icode]fflush(stdin)[/icode] to "flush the input buffer". this is patently wrong. the rule is (and click if you don't believe me) : [URL="http://faq.cprogramming.com/cgi-bin/smartfaq.cgi?answer=1052863818&id=1043284351"]NEVER [/URL][URL="http://answers.yahoo.com/question/index?qid=20071013052534AAuxWmW"]USE [/URL][URL="http://www.gidnetwork.com/b-57.html"]"FFLUSH()"[/URL] [URL="http://www.linuxforums.org/forum/linux-programming-scripting/41287-problem-fflush-stdin-function.html"]ON [/URL][URL="http://www.it.usyd.edu.au/~dasymond/mirror/c-faq/stdio/gets_flush2.html"]INPUT [/URL][URL="http://www.cplusplus.com/forum/general/6554/"]STREAMS [/URL][URL="http://c-faq.com/stdio/stdinflush.html"]SUCH [/URL][URL="http://gcc.gnu.org/ml/gcc-help/2009-01/msg00287.html"]AS [/URL][URL="http://www.dreamincode.net/forums/showtopic45833.htm"]"STDIN" [/URL] here is one method of properly … | |
so there's an argument about best practice for #include statements. many people put all the relevant #include <header.h> statements at the top of the .c source code. some people prefer to put the relevant #include statements within the .h header file that is associated with the .c source code consider: … | |
i dont normally work in the console/terminal window in my day job. so, i keep rewriting this every time i respond to someone needing help related to getting user input. im putting it here partly so i dont have to keep rewriting it. this function will get a string input … | |
| |
i know this is about MySQL, but there is no 4GL forum, so i'm hoping one of you experts might know: we have an application that uses Progress (on a unix system) that imports data from .csv files and writes the various fields to the database. one particular type of … | |
gcc supports an extended precison "long double" type typically 10 or 12 bytes but Windows XP always maps the "long double" to the standard double (typically 8 bytes) MinGW on windows XP thinks it has a 12-byte "long double" but in fact it only has the 8 byte support on … | |
i know the general answer to using [ICODE]goto[/ICODE] is always "No!". I understand why, especially when teaching basics to new programmers, because it can lead to very bad practices and horrible spaghetti code. but ... when i write certain hardware drivers, i have to immediately cease executing a function if … | |
i don't recommend atoi() or atol(). this does not handle invalid strings (non-integer strings) very well at all. for instance, if you try [code]value = atoi("CowAndChicken");[/code]the result will be zero (value = 0) and if you try [code]value = atoi("0");[/code]the result will also be zero (value = 0) strtol() avoids … | |
I don't understand. Nobody in the US uses this crappy compiler with it's non-standard libraries. No one in the Western World seems to use this. even in second world countries in central and south america, they don't use this. so how is it that Borland seems to have a complete … | |
im going to risk getting a beating, because this is something i should (used to?) know... anyhoo, given a function, how do you tell the size of the array that is passed? obviously trying to find the sizeof the pointer doesn't work (it returns the size of the pointer, duh) … | |
so im working in an environment (National Instruments) that auto-generates header files for the GUI. in my GUI, i have 150-some odd LEDs arranged in a matrix to represent a large relay bank. my LEDs are named and sequenced numerically like [code]PANEL_LED_1 PANEL_LED_2 ... PANEL_LED_150 etc...[/code] which would allow me … | |
some people think section 11.1 of the Google Docs TOS is the harbinger of the End of Days. other people say that's just mostly-meaningless legalese for Google to cover their own arses. then the first group says that the second group has drank the Mountain View kool-aid. the second group … | |
Disclaimer: I am not a webdesigner by any means, i only know enough to get my self into trouble. Im trying to help a non-profit fix their webpage, and Im having a rotten time getting IE and Firefox to agree. the front page is a 3x3 grid of pictures that … | |
so... whatchyallthink? i notice that this forum gets a tiny burst of activity about once a week. before posting this thread, the last couple posts here were made 9 days ago. then the next few were 17 days ago. and this pattern seems to be the same with other multi-language … | |
okay, experts, i need help. i can't seem to replace characters in a file, like i thought i would be able to: here's an example code. i put print and error stuff in there to try and debug. everything seems to be working ... except that my filename is not … |
The End.