15 Archived Topics

Remove Filter
Member Avatar for jephthah

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 …

Member Avatar for David_50
0
6K
Member Avatar for jephthah

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: …

Member Avatar for Ancient Dragon
0
486
Member Avatar for jephthah

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 …

Member Avatar for BNF
1
1K
Member Avatar for jephthah
Member Avatar for jephthah

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 …

Member Avatar for jephthah
0
226
Member Avatar for jephthah

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 …

Member Avatar for Ancient Dragon
0
214
Member Avatar for jephthah

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 …

Member Avatar for nezachem
0
137
Member Avatar for jephthah

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 …

Member Avatar for Dave Sinkula
0
157
Member Avatar for jephthah

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 …

Member Avatar for jephthah
2
139
Member Avatar for jephthah

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) …

Member Avatar for nalply
0
513
Member Avatar for jephthah

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 …

Member Avatar for jephthah
0
98
Member Avatar for jephthah

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 …

Member Avatar for Narue
0
67
Member Avatar for jephthah

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 …

Member Avatar for jephthah
0
111
Member Avatar for jephthah

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 …

Member Avatar for Major Major
0
263
Member Avatar for jephthah

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 …

Member Avatar for jephthah
0
285

The End.