5,237 Posted Topics
Re: If n is a power of 2, look at the value in binary. Then look at the binary representation of n-1 | |
Re: If each file is taking up to 30 minutes, and you have lots of files, then the total run time is going to be many hours, possibly an overnight job, or even days. Why do you need a per-second update of progress? Or why do you have so much "free" … | |
Re: > I'm redirected to a strange 'Yahoo!' like URL starting like this: Did you click "yes" to try out the Yahoo toolbar when you updated Java? IIRC, one of the things it grabs is the "page not found" and redirects you to some search engine. It's a reasonably well behaved … | |
Re: US presidential elections are basically like games of poker. The person with the biggest pot of money has an advantage, but they can still screw it up, or get called by one of the under dogs with a "bluff". The under dogs sooner or later have to go "all in" … | |
Re: Well first you can write a program containing 3 functions executed sequentially. [code] int main ( int argc, char *argv[] ) { calculateMean(); printGreaterThanMean(); printNearestFactorials(); } [/code] When you can do those things, then worry about the thread issues. | |
Re: Only that "rat" and "tar" are anagrams (and permutations (and palindromes)), but "rta" would just be a permutation. | |
Re: You don't decrypt passwords, you hash them. [url]http://en.wikipedia.org/wiki/Cryptographic_hash_function[/url] User types in the password, you hash it, and you compare it with the previously hashed result in the password file. If they match, there is an exceedingly high probability that the user entered the correct password. | |
Re: So do you know (for example) how to tell if a number is even or odd? Do you know how to arrange 3 numbers in order, ignoring the even/odd part of the problem? | |
Re: How about you post YOUR attempt, then we suggest where you might have gone wrong. As opposed to expecting us to do all the work for you. | |
Re: In C, there is stdin, stdout and stderr, which are the standard I/O streams. Call your function something else. | |
Re: Bring it on fool - I've found a new sport. Rep in the lounge is a toy, but doesn't count for anything. Rep elsewhere is still a toy, but actually counts. You like bad apples, well you're going to find a LOT of red ones on all your other posts … | |
Re: Or perhaps "Learn C++ in 24 hours from a thread that is 5 YEARS OLD". It's remarkable how many threads on DW get dug up on the anniversary of their original post date. I'm convinced the search here doesn't care about years, but latches onto the month and day like … | |
Re: > ifstream file (filename, ios::in|ios::binary|ios::ate); The output stream needs to be binary as well. | |
Re: > Why does it always return true?! Why don't you run it in the debugger and find out which path through the code it takes. I mean, if it always hits line 29, then you're looking in the wrong place. | |
Re: Sounds like a good place to start. | |
Re: Your best bet is to visit the maintainer site for that package, and a) see if there are any updates b) read the FAQ to see if it's a common problem with known answers c) ask on THEIR forum, as there you will find the MOST people with the MOST … | |
Re: Well if you just want to compare, then writing the dates out in yyyymmddhhmmss format allows you to use normal string comparison functions. Or you could parse out the data, and use [URL="http://pubs.opengroup.org/onlinepubs/009695399/functions/mktime.html"]mktime()[/URL] to give you some integer representation of time, which again can be compared to see which is … | |
Re: So apart from adding "using namespace std;", have you done anything else to the code? That is, apart from simply doing copy and paste from here [url]http://www.scribd.com/doc/51963645/bank-cpp[/url] > I am not sharp in programmin No, and unless you actually buckle down and start writing YOUR OWN PROGRAMS, you never will … | |
Re: Well that depends on how much you plan to change before it is regarded as "not Linux anymore". Linus may have written version 0.1 as a solo effort about 20 years ago, but it's been a cast of 10,000+++ to get it to where it is today. | |
Re: Meanwhile, progress over here -> [url]http://forums.devshed.com/c-programming-42/errors-converting-c-to-c-835932.html[/url] If you're going to cross post (not that it is recommended), at least have the courtesy to include reference to other help so we don't go over all the basics AGAIN!. | |
Re: Well first off, you must be using some ancient fossil compiler. What was the error message exactly? Something like "floating point formats not linked"? Anyway, cleaned up for the modern world, your code seems fine. It's just the include files renamed, and int main at the end. [code] #include <fstream> … | |
Re: > Also I've searched my entire C reference book (written by Herbert Schildt) Perhaps you want a better book. [url]http://www.catb.org/jargon/html/B/bullschildt.html[/url] | |
Re: [url]http://lmgtfy.com/?q=circular+linked+list[/url] Even that little bit took more effort than your useless topic title and brief text. [url]http://www.catb.org/~esr/faqs/smart-questions.html#bespecific[/url] | |
Re: %c ALWAYS takes the next character, including things like space and newline. Try say scanf(" %c",&var) | |
Re: Sure, write out 2,-6,5 in binary. > int p:3; Then take the right-most n-1 bits as the value, and the n'th as the sign bit. The valid range of p for example is -4 to +3 | |
Re: It's hard to know where to begin. I suppose we could begin with where you copy/pasted it from. [url]http://www.scribd.com/doc/48581406/New-Text-Document[/url] Try writing your own code for a change, as opposed to - find random crap on the web - find it doesn't compile (gosh, shock, horror) - dump the sorry mess … | |
Re: Well it will be a lot easier to answer if you tell us which OS you're using. | |
Re: Same answers as your other thread. [url]http://www.daniweb.com/software-development/cpp/threads/373847[/url] Are you even listening? | |
So which direction is this forum heading in? On the one hand, happygeek seems to think it's all about the [URL="http://www.daniweb.com/community-center/daniweb-community-feedback/threads/370906"]quality[/URL]. But when it comes to doing something about it, the enthusiasm seems to be [URL="http://www.daniweb.com/community-center/daniweb-community-feedback/threads/373196/1607319"]more muted[/URL] On the other hand, all Dani seems to care about is [URL="http://www.daniweb.com/community-center/area-51/threads/369598"]post and … | |
Re: [url]http://cboard.cprogramming.com/cplusplus-programming/139806-borland-cplusplus-builder-draw-waveform.html#post1041378[/url] | |
Re: > Is there a way around this? Yes, get a 64-bit processor with at least 8GB of memory, and an OS/Compiler that can actually take advantage of all that hardware. Or you figure out how to factorise your problem into say 8 iterations with 500x500x500 blocks (assuming that will fit … | |
Re: %d = decimal %o = octal %x = hex Seemed as plausible as anything to me. | |
Re: What's with all the "how to do x without using the obvious x" questions? [url]http://www.daniweb.com/techtalkforums/thread80025.html[/url] | |
Re: > How could I compare the efficiency between them? Use a profiler. In big-O terms, the algorithm is the same, so the complexity is the same. Generally speaking, iterative solutions tend to be more efficient, but you also have to write more code to make it work. Simple recursive functions … | |
Re: Perhaps something like this? [code] printf("Enter a number between 10 and 50: "); if ( scanf("%d", &myint) == 1 && myint >= 10 && myint <= 50 ) { // do stuff } [/code] But if you wanted to really make it bomb-proof, you would need to use fgets() to … | |
Re: "your code"? Seems remarkably similar to this 2005 vintage effort on another forum. [url]http://www.pronetworks.org/forums/c-bug-in-program-t53260.html[/url] Perhaps you should a) try writing your own code b) post your actual error messages Some of us here really don't like the "I found this code, please fix it for me" [URL="http://dictionary.reference.com/browse/schtick"]schtick[/URL]. | |
Re: @sergent [url]http://sourceforge.net/apps/mediawiki/cpwiki/index.php?title=Indentation[/url] I'll comment further when I can stomach reading your code. > How about something less tricky. Like for example using a function instead of some hacky multi-line macro. | |
Re: main.obj : error LNK2019: unresolved external symbol "void __cdecl teamstructure(void)" (?teamstructure@@YAXXZ) referenced in function _main C:\Users\daniel\documents\visual studio 2010\Projects\world cup sim\Debug\world cup sim.exe : fatal error LNK1120: 1 unresolved externals Assuming say teamstructure.cpp is actually in the project and compiled (do a rebuild all to be sure), then the next thing … | |
Re: [url]http://sourceforge.net/apps/mediawiki/cpwiki/index.php?title=Pause_console[/url] | |
Re: > ret = GetFileAttributesEx((LPCWSTR)File.c_str(), fInfoLevelId, &lpFileInformation); The first problem is you can't just go around casting whatever just to make the compiler STFU. If the function really is expecting a wide string, then simply casting a narrow string pointer just doesn't cut it. You need a proper conversion of File.c_str() … | |
Re: I wouldn't mind so much if there were some balance between "good" posts and "bad" posts on the end of dead threads. But as it stands, the ratio is around 1:999 in favour of bad posts. Bad posts we see repeatedly on a daily basis. Good posts - well when … | |
Re: You should post your actual error message, because I'm pretty sure that whatever you're seeing is not a segfault. segfaults happen when you access out of bound array indices, or "garbage" pointers. Your loop contains neither of these things (unless this isn't your real code). Examples. The flawed code [code] … | |
Re: Perhaps something like this. [code] string line; while ( getline(file,line) ) { istringstream s(line); string word; while ( s >> word ) { cout << line << " "; } cout << endl; } [/code] | |
Re: Step 1 is learn how to indent code (or at least post indented code on a forum). Your smart IDE editor might be able to make sense of it, but on a forum, it looks like dog food. Here is your code, courtesy of [ICODE]indent -kr -nut -ts2 -i2 foo.cpp[/ICODE] … | |
Re: [url]http://msdn.microsoft.com/en-us/library/dd183411%28v=vs.85%29.aspx[/url] It seems to return a number of different values. Perhaps you should look at/print the other values as well as just checking for DISP_CHANGE_SUCCESSFUL. It might give you some clue as to where to start looking next. | |
Re: Get someone to read these numbers to you, and you try to remember what the highest and lowest numbers you hear. 31 47 85 64 95 48 45 86 26 61 47 76 98 80 62 19 4 12 10 78 | |
Re: [url]http://online.wsj.com/article/SB10001424052748703515504576142092863219826.html[/url] First step would be improving your English. Talk to a few actual employers in your area to find out what they actually expect from graduates. | |
I'm getting rather fed up with seeing activity in the geeks lounge, only to find out it's only the terminally bored time-wasters in posting games sub-forum. If it's not going to be deleted (as per suggestions in other threads), can it at least be made opt-in/opt-out, so that those who … | |
Re: Well it would help if you could post code with a decent approach to [URL="http://sourceforge.net/apps/mediawiki/cpwiki/index.php?title=Indentation"]indentation[/URL] It also helps to remove all the commented out code you accumulated, at least for the purposes of posting it on a forum. Something like this. [code] #include <iostream> #include <fstream> #include <string> #include <nurbsS.h> … | |
Re: [url]http://www.dreamincode.net/forums/topic/240357-question-cinema-seating-system-for-project/[/url] How about spending time working on the problem, as opposed to working out where else on the internet you can spam your homework. |
The End.