5,237 Posted Topics
Re: Perhaps simplify the code. Say you have a card class. There are 52 instances of that in a deck. Then you 'deal' 5 of those instances into another thing called a hand (of 5 cards). | |
Re: > void CalculatePrimes() First off, this should be declared as [ICODE]void *CalculatePrimes(void *p)[/ICODE] When you do this if (pthread_create(&th, &ta, (void * (*)(void *))CalculatePrimes,(void *) i) < 0) You can get the parameter i passed to the thread like this [code] void *CalculatePrimes(void *p) { int param = (int)p; } … | |
Re: [url]http://www.daniweb.com/forums/announcement118-2.html[/url] | |
Re: [url]http://en.wikipedia.org/wiki/Digital_signal_processing[/url] But if you're trying to do this yourself, then get comfortable for some serious maths. > 2. Is comparing the frequency of the wave files still possible? I've no idea. But the simpler your answer is, the more likely it is that it will be very specific to only … | |
Re: > Where can I find software and physical parts for making miniature robots Mmm, lessee now, what's it called again? [url]http://clusty.com/search?query=robotics+kits&sourceid=Mozilla-search[/url] Hot diggetty, that's right, now I remember.... > Does anybody know where I can get such equipment? [URL="http://www.catb.org/~esr/faqs/smart-questions.html#prune"]Everybody does, but nobody's sayin a thing[/URL] -ve rep welcome; it seems … | |
Re: First, compile with as many warnings as you can. The compiler will spot things like uninitialised variables, which is a common mistake. Fortunately for you, this seems not to be the case, but still there are issues. [code] $ g++ -W -Wall -ansi -pedantic -O2 foo.cpp foo.cpp: In function ‘int … | |
Re: > what you consider is the best tool for a developer to achieve more and best payed works? None of them. a) the going rate for a particular skill depends on geography (where are you?) b) it depends on the economic cycle. c) it depends on whether it's been made … | |
Re: How about posting a SMALL and complete snippet of code which demonstrates the problem. There's more than a passing chance that there's something wrong with your code than there is with the library code. Success on one system can easily be attributed to "luck" rather than "skill". | |
Re: If you're absolutely, positively sure you can re-install from the CDs you have, then use DBAN to wipe it all clean. [url]http://www.dban.org/[/url] If you're relying on a hidden recovery partition then exercise caution. This is extreme "Do not pass GO, do not collect $200" territory! Another idea is to put … | |
Re: [url]http://clusty.com/search?query=bittorrent+protocol&sourceid=Mozilla-search[/url] | |
Re: Google much? [url]http://clusty.com/search?query=identify+OS+from+ICMP+&sourceid=Mozilla-search[/url] | |
Re: So when y == 1, reverse the sign When y == -1, reverse it again. | |
Re: Sorry, but your indentation (or lack of) is just too much trouble to read. | |
Re: > what i am stuck at is how to do the union and intersection. any hints or help on where to start? union = if it's in either, then set the result intersection = if it's in both, then set the result. The rest is just for loops. | |
Re: For that amount of effort - not a chance! [url]http://www.daniweb.com/forums/announcement14-2.html[/url] | |
Re: So can you do the very first step, and the very last step? - read an integer value - and display it ? These things are built one step at a time. Don't look at the whole assignment, imagine smaller parts. | |
Re: Remove the exit(0); call. It kills the entire program, not just the if (or the while). Look up 'break' and 'continue' for more refined loop controls. | |
Re: [quote=poem] This is a story about four people named Everybody, Somebody, Anybody, and Nobody. There was an important job to be done and Everybody was sure that Somebody would do it. Anybody could have done it, but Nobody did it. Somebody got angry about this, because it was Everybody's job. … | |
Re: > if (s[i] == 'a'||'A'||'e'||'E'||'i'||'I'||'o'||'O'||'u'||'U') I explained why this was wrong in your previous thread :@ [url]http://www.daniweb.com/forums/thread262721.html[/url] | |
Re: Is it really a sandbox? Because if it isn't, your test just runs garbage until it hits a problem. Try adding [CODE] MOV eax,1 ; Code for Exit Syscall mov ebx,0 ; Return a code of zero int 80H ; Make kernel call[/CODE] to the end of your 'sandbox' test. | |
Re: > Need immediate responses plz with references Sure, anything else you would like? [URL="http://google.com"]This perhaps[/URL]? [attach]13834[/attach] Governments spend millions trying to answer that question, and generally end up making a pig's ear out of it. Did you expect you could just roll into a forum and get an answer just … | |
Re: > bool checkStatus(int board[3][3]) You should pass a player parameter, so you don't duplicate all the code for 'X' and 'O' > if (board[i][j] == 1) But your checking function tests 'X' and 'O' You have two boards (bad), and an inconsistent approach. The 1 becomes 'X' should only happen … | |
Re: > What's the simplest way to write a Prime Factorization program in C++? The simplest (for you) is to post your homework on a forum. Which you've just done, so congratulations! Now the bad news: This is our standard reply -> [url]http://www.daniweb.com/forums/announcement8-2.html[/url] | |
Re: Well to use a library takes two steps. The first tells the compiler about (say wrefresh(), it's name, parameters etc), and you do this with #include The second tells the linker WHAT actually implements the functionality you requested. If your library is called libcurses.a, then you typically have [ICODE]-lcurses[/ICODE] as … | |
Re: LOL@Dave :) [url]http://cboard.cprogramming.com/c-programming/124248-variable-dynamic-paths-c.html[/url] Now go there and recommend a Daniweb FAQ for completeness :D | |
Re: My name is [URL="http://en.wikipedia.org/wiki/Major_Tom"]Major_Tom[/URL] For other "military" types... Who is General Failure, and why is he trying to read my hard disk? | |
Re: Try searching the board for all the other "project" threads on the boards, from a range of dweebs unable to think for themselves. Along with a range of standard answers as well :D 3+ years of college, and not a single idea of your along the way - how the … | |
Re: So what does your code look like now? | |
Re: The problem is elsewhere in your code. > and i get.an error...._BLOCK_TYPE_IS_VALID(pHead->nBlockuse) These only appear only when you try to allocate or free memory. If you damage the memory pool, you don't get any error at the point the damage occurs, only (possibly) at some later alloc/free. Eg. [code] char … | |
Re: > Plz guyz help me coze i am not successfull in writing the code.... So drop the course already, and stop wasting everyone's time (including yours). Your homework (which is astonishingly simple for college level) is about as simple as it gets. Next weeks homework won't be any easier, and … | |
Re: [url]http://bash-hackers.org/wiki/doku.php/howto/getopts_tutorial[/url] | |
Re: > system("cls"); Have you any idea how long this takes?!! This is a mountain, the rest of your program is a grain of sand by comparison. You might also try [code] if ( i % 1000 == 0 ) { cout<< ans <<endl; } [/code] So you only print out … | |
Re: By not having TWO loops to print *'s Calculate how many * each row should have, and then have one loop to do that. | |
Re: [CODE]C:\Duh>copy /? Copies one or more files to another location. COPY [/D] [/V] [/N] [/Y | /-Y] [/Z] [/L] [/A | /B ] source [/A | /B] [+ source [/A | /B] [+ ...]] [destination [/A | /B]] source Specifies the file or files to be copied. /A Indicates an … | |
Re: Really old [url]http://www.daniweb.com/forums/thread83567.html[/url] A more recent copy/paste job [url]http://www.daniweb.com/forums/thread255734.html[/url] Guess how I found them.... | |
Re: [url]http://www.catb.org/~esr/faqs/smart-questions.html#urgent[/url] How about the woeful inadequacies of data security in organisations that really ought to know better. Especially when those same organisations spout "data security" at their customers. [url]http://www.telegraph.co.uk/finance/personalfinance/building-societies/7139076/Skipton-apologises-after-account-details-are-revealed.html[/url] [url]http://www.telegraph.co.uk/finance/personalfinance/insurance/6406249/Insurer-Zurich-loses-customers-details.html[/url] and the biggie [url]http://www.telegraph.co.uk/news/newstopics/politics/labour/4013138/Government-departments-losing-a-computer-every-day.html[/url] | |
Re: Use a compiler that is matched to your OS perhaps? Seriously, just because the compatibility layer makes simple "hello world" programs work for these fossil compilers doesn't mean you can then use them to go rummaging through the dark corners of the system with impunity. Judging from some other recent … | |
Re: > Mr. Walt there are 24 different errors how would you like me to list them. [url]http://cboard.cprogramming.com/c-programming/88495-development-process.html[/url] Start small and compile(*) often. Whilst you're learning, you have to accept that most of the time the compiler will just spit your latest effort out. It works like this: = If you … | |
Re: Is that it? Or are you going to wait for us to guess your OS and Compiler? | |
Re: Get visual studio express -> [url]http://www.microsoft.com/express/Downloads/[/url] and leave the stone tools to the [URL="http://edn.embarcadero.com/article/20841"]archaeologists[/URL]. | |
Re: Well you've got the idea of "parallel" off down to a tee! [url]http://cboard.cprogramming.com/c-programming/124176-parallel-code-mpi.html[/url] [url]http://forums.devshed.com/c-programming-42/mpi-code-679588.html[/url] With such massive expertise at parallel posting, what do you need us for? [URL="More parallels"]http://en.wikipedia.org/wiki/Parallel_parking[/URL] | |
Re: Personally, I regard SE as being a superset skill of programming. Programming in it's narrow sense is just turning detailed design into code. SE in it's broadest sense covers the whole software development life cycle. But, you will be able to find: - SE courses which are little more than … | |
Re: [url]http://beej.us/guide/bgnet/[/url] > send(clientfd, buffer, recv(clientfd, buffer, MAXBUF, 0), 0); How many different return states do send() and recv() have between them? How many are you checking? - ZERO! > memcpy(&self, 0, sizeof(self)); Do you know the difference between memset() and memcpy()? > struct timeval timeout; But only if you're interested … | |
Re: It's short for [ICODE]while ( tok != NULL )[/ICODE] NULL being returned by the strtok() call in the loop (at some point). | |
Re: [url]http://support.microsoft.com/kb/282793[/url] Found by an astonishingly simple google search.... | |
Re: What's the difference? [code] void foo ( ) { int a; // uninitialised :( } [/code] vs. [code] void foo ( ) { int a = 0; // initialised :) } [/code] > warning C4700: uninitialized local variable 'third' used So initialise them then! | |
Re: - write a function to read a number string into an array - write a function to right-justify that number in the array - write a function to perform long addition. Now which one is really bugging you? Perhaps post your attempt at step 1 and we can take it … | |
Re: > I still need the function to figure out the length of the array. Pass the length as another parameter. Or, consider the alternatives that [ICODE]std::vector[/ICODE] offers. The sizeof thing you posted only works when the actual array definition is in scope. As soon as you call a function, you're … | |
Re: [url]http://www.daniweb.com/forums/announcement42-2.html[/url] Not to mention, you also forgot to mention which language you want help with. | |
Re: > if(strcmp(pizza, Plain)) strcmp() returns ZERO when the strings match. |
The End.