5,237 Posted Topics
Re: > srand((unsigned)time(0)); Run at full speed, how much time do you think is going to elapse between the first iteration and the last? Answer - not much. In other words, time() returns a constant, therefore your randomiser returns a series of constants, therefore your code always does the same thing. … | |
Re: > v=(float *)malloc((size_t) ((nh-nl+1+NR_END)*sizeof(float))); > return v-nl+NR_END; Do you want to explain these? Problems include - meaningless variable names - poorly to non-existent indentation - a chaotic mix of C and C++ code. | |
Re: Read the rules, we don't give you code just because you managed to cobble together some buzz-words in the hope that it looks like effort. | |
Re: Well the first question is, can you solve this problem using regular iteration? | |
Re: > Account operator +(const Account &rhs,double i) Where is this, in your class, as a public function? | |
Re: You figured out the hard way, and now you're having trouble with the easy way? | |
Re: I assume you want to sort the data that is contained in the XML file, and not the XML file itself. Just sorting the XML makes no sense, since what you get is no longer XML. | |
[url]http://www.daniweb.com/forums/thread185352.html[/url] Looks 'sheared', but OK when clicked on. [attach]10118[/attach] | |
Re: [url]http://clusty.com/search?query=chatbot&sourceid=Mozilla-search[/url] How did you make it to your final year without knowing how to do this? | |
Re: Good for you. Now YOU go and read the forum rules, and post some actual effort, instead of just dumping your homework on us. | |
Re: All you've managed to do is post an invalid program (void main is wrong), which won't even compile (missing ; abound), and even when all that is fixed, will trash memory past the end of the array. Not to mention, NO CODE TAGS. Want a cookie? | |
Re: > "where's the love?" It's been downsized :D | |
Re: Piping works, if you can do this [ICODE]open -e[/ICODE] [COLOR="Green"]/path/to/file[/COLOR] That is, if you just type in the "[ICODE]open -e[/ICODE]", it gives you some kind of prompt for a filename. If it doesn't do that, then piping isn't the answer. Most things do however accept a filename on the command … | |
Re: And where is your 'try' at the actual C++ code? | |
Re: What do you think the result will be? Nevermind, the answer is 42. | |
Re: Do you want us to guess which processor and host OS you're using? | |
Re: Most people leave it until there's less than 12 hours to go before running round screaming URGENT (which it isn't by the way) [url]http://www.catb.org/~esr/faqs/smart-questions.html#urgent[/url] 4 days is plenty of time for you to make a stab at solving these trivial problems. Besides, you've got over 70 posts, which means you … | |
Re: [url]http://www.parashift.com/c++-faq-lite/operator-overloading.html#faq-13.10[/url] And the next few entries as well. | |
Re: The vagueness continues [url]http://www.daniweb.com/forums/thread191291.html[/url] > Again i not asking anyone to do my work just the right push in the right direction Try asking an actual question in one of the actual support forums. [url]http://www.daniweb.com/category2.html[/url] Y'know, a post containing the following - a summary of the problem - YOUR attempt … | |
Re: Sure there are plenty who 'can'. 'will' on the other hand is another matter. 100K+ of source code scattered through a couple of dozen source files is a hell of a lot to ask someone else to fix for you. Especially with your "no clues" approach, like error messages, specific … | |
Re: [quote=man page] -R, --recursive change files and directories recursively [/quote] [url]http://www.rt.com/man/chmod.1.html[/url] | |
Re: This is as fast as I can manage [url]http://www.catb.org/~esr/faqs/smart-questions.html#urgent[/url] | |
Re: > cin>>stus[NUM]; Well this is outside your array. Perhaps you meant [ICODE]cin>>stus[x];[/ICODE] | |
Re: [url]http://clusty.com/search?query=data+mining&sourceid=Mozilla-search[/url] | |
Re: > I would like to reduce the processing time. To what - video frame rate? Which OS/Compiler are you using? Do you have multiple cores on your CPU? Are you using all of them? | |
Re: Checking for == 6 (the actual number of conversions you expect for success) would be better than simply >0 Reading a line using fgets(), then parsing the result with sscanf() (or something better) would help as well. Partial fails of fscanf leave the input stream in a horrible mess. | |
Re: > printf (astr) NEVER do this! [url]http://en.wikipedia.org/wiki/Format_string_vulnerabilities[/url] The format string of printf/scanf must always be under your control, ideally in read-only memory. All someone would have to do with your code is feed it some lines with % chars, and watch the fun begin! | |
Re: Well read literally, you have [ICODE]tot = CLng( tot ^ !lngdata)[/ICODE] But is XOR-NOT is some new operator which is the logical inverse of XOR (like NAND is to AND), then perhaps one of these [ICODE]tot = CLng( !tot ^ !lngdata) tot = CLng( !(tot ^ lngdata) )[/ICODE] Post a … | |
Re: > I have noticed that void works good. Just so you know what undefined behaviour means. My program works. Your program crashes. His hard disk has been reformatted. The second thing you need to learn is that all compilers expand the language in many non-standard ways in order to make … | |
Re: > can you possibly be more vague? Or more repetitive ;) [url]http://www.daniweb.com/forums/thread191160.html[/url] | |
Re: > void StuRead(&ifstream studentType students[]); type name comma type name comma and so on | |
Re: Why jump ship in the middle of making good progress? [url]http://cboard.cprogramming.com/cplusplus-programming/115570-plzzzzzz-i-need-help-natural-merge-sort.html[/url] | |
Re: > that will convert Python code to 'C' code . Why? Performance reasons? As already stated, replicating a lot of the "free" functionality using your own C code is going to take work. Also, python (in common with many modern interpreted languages) is bytecode compiled before it is run. If … | |
Re: You're given a formula, which takes 1 line of code. You've given a template which has everything except that line of code. What do YOU want? | |
Re: I thought [URL="http://en.wikipedia.org/wiki/Jell-O"]jelo-C[/URL] was a new programming language in a variety of fruity flavours ;) | |
Re: Ask your IT guy where the support contract for this program is placed. What kind of program is it? It seems like it's some 40 year old DOS fossil from the way you describe it. > We use a lot of paper So your process is something like - you … | |
Re: Pseudo-code [code] # is score enough to make it onto the table anyway? if ( score > table[last] ) { table[last] = score; # drop the last place in favour of the new score sort( table ); # sort to find it's true place in the table } [/code] | |
Re: 52040292466647269602037015248896 That's the size of your last file - are you sure you want to do this? Y'know, some simple maths to determine whether your plan will actually yield a result in lets say the age of the universe? | |
Re: Of course the best "revenge is a meal best served cold" is for the kids to turn round and put the parents in the worst possible nursing home they can find. Maybe a few lawsuits for damages would slow the trend as well. | |
Re: > delete[] a; And new is called where? | |
Re: Well you could have used code tags. | |
Re: Without some supporting declarations, it's all pretty meaningless. | |
| |
Re: Does your code look this neat to you? [code] do { do { system("cls"); printf("Enter the name and path of a .TXT file(type 1 to end):\n"); fflush(stdout); fgets(fname, 128, stdin); if ((s = strchr(fname, '\n')) != NULL) *s = '\0'; /* remove newline char */ fp = fopen(fname, "r"); if … | |
Re: [ICODE]FILE *debug = fopen("debug.txt","a");[/ICODE] Then use fprintf() for your debug. Simple - no? | |
Re: If you're trying to optimise your courses based solely on minimising the workload, then you're on the wrong course, and in the wrong place. Job interview: Q: What motivated you to choose these courses? Your A: I'm lazy, so I picked the ones with the least workload. That'll go down … | |
Re: > It's a 2-D array, so it's more like an int**, not an int*. Only in as much as you can use [x][y] notation to step through them. A pointer to a 2D array is NOT the same as a pointer to a pointer. [url]http://c-faq.com/aryptr/pass2dary.html[/url] An example of actual pointers … |
The End.