2,384 Posted Topics
| |
Re: Mine was already taken, so here are a couple of loftovers. [quote]Sometimes when I reflect on all the beer I drink I feel ashamed. Then I look into the glass and think about the workers in the brewery and all of their hopes and dreams. If I didn't drink this … | |
Re: [url=http://www.daniweb.com/techtalkforums/announcement8-2.html]Announcement: We only give homework help to those who show effort[/url] | |
![]() | Re: Infinite recursion? [code] if ( crap[i] == '-' ) { crap.replace(i,1," - "); [COLOR="Blue"]i += 2;[/COLOR] } [/code] ![]() |
Re: You'll have to actually write your sorting function and call it correctly, using an array. | |
Re: [url=http://www.daniweb.com/techtalkforums/announcement8-2.html][U]Announcement[/U]: We only give homework help to those who show effort[/url] | |
Re: [QUOTE=~s.o.s~]lol maybe this is what you are looking for system("pause");[/QUOTE]Yes, a more vulnerable and less portable solution is always better than a safe, portable one. :lol: :rolleyes: | |
Re: [url]http://en.wikipedia.org/wiki/Object-oriented_programming[/url] | |
Re: [aside] I tend to agree with 'Dragon here. Like comments that don't match the code, a flowchart may not match the implementation code. And then you get to debug in two places -- the flowchart and the actual code. Which one is correct? Bleah. And the implementation always seems to … ![]() | |
Re: Life will be simpler if you [I]always[/I] take user input as a [INLINECODE]std::string[/INLINECODE] using [INLINECODE]getline[/INLINECODE] (and later convert it to a number if need be). | |
Re: [QUOTE=Shadowhawk]Yes, but [B]fflush(stdin);[/B] will do as well...[/QUOTE]No! No! No! No! No! NO!!! [url]http://c-faq.com/stdio/stdinflush.html[/url] | |
Re: Are you reading [I]How to Program for the 1970's[/I]? Googling will get you the answer you are seeking, but then after you know it, don't ever use it for programming today or in the future -- use a temporary variable. Solving yesterday's problems today is useful to understand the techniques, … | |
Re: Hmm. Clues here: [url]http://www.gotw.ca/gotw/017.htm[/url] ? | |
Re: You've got a 3-element array. Why are you trying to manipulate 4 elements?[code]#include <iostream> int main() { int array[] = {1,2,3}, *ptr = array; for ( std::size_t i = 0; i < sizeof array / sizeof *array; ++i ) { std::cout << "array [ " << i << " ] … | |
When I'm scrolling through a post that contains a block of code, I get a leftover line in the block with each scrolling. Firefox 1.5.0.4, Win2k SP4. | |
Re: [quote] Re: 32 BIt Flat Real mode [COLOR="Magenta"]Jan 27th 2006, 09:48 AM[/COLOR][/quote]Let sleeping threads lie. | |
Re: Where do you define [INLINECODE]CConflexDlg::thing[/INLINECODE]? | |
Re: Posting a complete example is always preferred. Check whether or not the argument to [INLINECODE]sqrt[/INLINECODE] will be a negative value to avoid issues. | |
Re: Is one-character-at-a-time possible? What is the intended output? | |
Re: What have you tried so far? There are RFCs and standards out there that may help decsribe the encodings, but I have not worked much with them. | |
Re: return is a keyword, so it cannot be the name of a variable.[code]char return;[/code]You seem to be missing a variable name here.[code]int == 0;[/code]And == is comparison, not assignment or initialization. This is surely hosed.[code]switch ( choice )[COLOR="Magenta"];[/COLOR][/code]This is missing the closing quote.[code]printf("\n\t1 1);[/code]And this needs work too.[code]for ( FiboDisp … | |
Re: [url]http://faq.cprogramming.com/cgi-bin/smartfaq.cgi?answer=1046380353&id=1044780608[/url] | |
Re: That code is not valid. What are you trying to ask? | |
Re: [url]http://c-faq.com/stdio/fupdate.html[/url] | |
Re: [QUOTE=andor]Here is an idea. Convert to char *[/QUOTE]Bad idea (unless you care to elaborate). Often using division (/) and remainder (%) operations is used for homework. | |
Re: My link is right to C and C++. [url]http://www.daniweb.com/techtalkforums/forumdisplay.php?s=&daysprune=&f=8[/url] I rarely see the home page. I visit other forums, some of the Coffee House stuff, via the menu or the Forum Jump. [edit]Hmm. Speaking of the menu, is there a way to have the Code Snippets or Tutorials also have … | |
Re: [code]while (! readfile.eof())[/code][url=http://www.daniweb.com/techtalkforums/post155265-18.html]Avoid Loop Control Using eof()[/url] | |
Re: Simplify first, then move on. [code]#include <stdio.h> #include <string.h> int main(int argc, char *argv[]) { if ( argc > 1 ) { char filename[FILENAME_MAX]; strcpy(filename, argv[1]); strcat(filename, "_new"); printf("filename = \"%s\"\n", filename); } return 0; } /* my output filename = "myprog_new" */[/code] | |
Re: Thanks for resurrecting a thread to point that out. :rolleyes: | |
Re: You really want to separately compile and then link each compiled output. I'm not too sure of the syntax, but something like this:[code]$ g++ -Wall -o test main.cpp test.cpp[/code]Don't #include source in other modules. And I don't think you want to call your executable test. | |
Re: If you want to change a value in a called function, you need to pass a pointer to the value. If what you want to change [I]is[/I] a pointer, you need to pass a pointer to the pointer. | |
Re: [URL="http://xmlsoft.org/index.html"]libxml[/URL]? ![]() | |
Re: [QUOTE=WolfPack]One Ring to Rule them all, One Ring to find them, One Ring to bring them all and in the darkness bind them. Lord of the Rings - page 272[/QUOTE]Ever seen Chris Torek's [URL="http://web.torek.net/torek/c/expr.html#therule"][I]The Rule[/I][/URL]?[quote][I]One Rule to ring them all One Rule to find them One Rule to point them … | |
Re: A Win32 Console Application expects [INLINECODE]main[/INLINECODE] to be defined somewhere. | |
Re: Google and Wikipedia make good starting points for such questions. [url]http://en.wikipedia.org/wiki/Base64[/url] | |
Re: [QUOTE=Alphabetized]Anyhow, i notice that all the programs I write open up in DOS, and my book doesnt say nething on how to change this.[/QUOTE]Well, I'd say first learn to understand the difference between a console application and a GUI application. A black rectangle does not equal DOS. Doing graphics requires … | |
Re: [QUOTE=Drowzee]The first version you posted is explicit, and, in my limited experience, is unnecessary. Just use the second version if you have no input arguments; there's no difference.[/QUOTE]There is a difference between the two in C or C++. [url]http://david.tribble.com/text/cdiffs.htm#C99-empty-parm[/url] | |
Re: It's running just fine. [url]http://faq.cprogramming.com/cgi-bin/smartfaq.cgi?answer=1043803465&id=1043284385[/url] | |
Re: Shouldn't there be a little more code in between there? [url]http://beej.us/guide/bgnet/output/html/syscalls.html#accept[/url] | |
Re: My usual advice: avoid [INLINECODE]scanf[/INLINECODE]: [url=http://www.daniweb.com/tutorials/tutorial45806.html]User Input: Strings and Numbers [C][/url] (And in the snippets links, I do show some things, such as [url=http://www.daniweb.com/code/snippet357.html]this[/url].) | |
| |
Re: It will write the contents of buff up the the null. Assuming that it is a char array as opposed to a string, and the char array contains embedded nulls, you will get less output than expected. Perhaps use [INLINECODE]fwrite[/INLINECODE] instead. | |
Re: freemind: You know that you're not supposed to put function bodies or variable definitions in a header, right? (Well, now you do.) I may actually help more later on, but there are many things that make this code difficult to look at and understand. So I'm taking my time. | |
Re: [INLINECODE]fflush(stdin);[/INLINECODE] Un-oh. 6000 or 1000? Could you attach the file to be sorted? What the heck is a supposed to be?[code]char a[0][1000];[/code]Does this compile for you? (Please compile C code with a C compiler.) | |
Re: [url]http://c-faq.com/aryptr/dynmuldimary.html[/url] | |
Re: While my crystal ball is out for polishing, why not post the lines of code associated with these errors? | |
Re: Is your OS actually DOS? (As opposed to a command shell within Windows which is not DOS?) |
The End.