5,237 Posted Topics

Member Avatar for menonnik

If n is a power of 2, look at the value in binary. Then look at the binary representation of n-1

Member Avatar for TrustyTony
0
188
Member Avatar for neely615

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

Member Avatar for griswolf
0
333
Member Avatar for mauconline

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

Member Avatar for crunchie
0
520
Member Avatar for pseudorandom21

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

Member Avatar for pseudorandom21
0
660
Member Avatar for nidajaffri

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.

Member Avatar for nidajaffri
-1
2K
Member Avatar for tubby123

Only that "rat" and "tar" are anagrams (and permutations (and palindromes)), but "rta" would just be a permutation.

Member Avatar for Adak
0
148
Member Avatar for clericcodered

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.

Member Avatar for clericcodered
0
216
Member Avatar for theCompiler

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?

Member Avatar for Salem
0
220
Member Avatar for duybk

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.

Member Avatar for duybk
-1
4K
Member Avatar for MareoRaft

In C, there is stdin, stdout and stderr, which are the standard I/O streams. Call your function something else.

Member Avatar for Salem
0
416
Member Avatar for skilly

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 …

Member Avatar for Nick Evan
-5
152
Member Avatar for wingwarp

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 …

Member Avatar for tiredoy
0
451
Member Avatar for chubakueno

> ifstream file (filename, ios::in|ios::binary|ios::ate); The output stream needs to be binary as well.

Member Avatar for chubakueno
2
177
Member Avatar for triumphost

> 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.

Member Avatar for Salem
0
220
Member Avatar for patrickw99
Member Avatar for angelfriend89

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 …

Member Avatar for Salem
0
362
Member Avatar for toneranger

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 …

Member Avatar for Ancient Dragon
0
242
Member Avatar for Muhammadlodhi

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 …

Member Avatar for Salem
0
970
Member Avatar for yonihahasis

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.

Member Avatar for Salem
0
78
Member Avatar for ogopa100

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!.

Member Avatar for Salem
0
267
Member Avatar for tiverton

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

Member Avatar for tiverton
0
206
Member Avatar for vincenzorm117

> 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]

Member Avatar for Narue
0
203
Member Avatar for jeesikabaskar

[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]

Member Avatar for Salem
-1
97
Member Avatar for ineedsomehelp:3

%c ALWAYS takes the next character, including things like space and newline. Try say scanf(" %c",&var)

Member Avatar for ineedsomehelp:3
0
128
Member Avatar for arindam31

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

Member Avatar for arindam31
0
4K
Member Avatar for CloudZELL91

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 …

Member Avatar for Salem
0
142
Member Avatar for emcyroyale

Well it will be a lot easier to answer if you tell us which OS you're using.

Member Avatar for emcyroyale
0
158
Member Avatar for dilequeno

Same answers as your other thread. [url]http://www.daniweb.com/software-development/cpp/threads/373847[/url] Are you even listening?

Member Avatar for Greywolf333
-1
197
Member Avatar for Salem

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 …

Member Avatar for Dani
0
235
Member Avatar for king5201

[url]http://cboard.cprogramming.com/cplusplus-programming/139806-borland-cplusplus-builder-draw-waveform.html#post1041378[/url]

Member Avatar for Salem
0
149
Member Avatar for dilequeno

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

Member Avatar for Salem
0
429
Member Avatar for dotancohen
Member Avatar for Ancient Dragon
0
132
Member Avatar for pretu

What's with all the "how to do x without using the obvious x" questions? [url]http://www.daniweb.com/techtalkforums/thread80025.html[/url]

Member Avatar for jayeshkamble143
0
599
Member Avatar for logicmonster

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

Member Avatar for abhimanipal
0
135
Member Avatar for logicmonster

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 …

Member Avatar for abhimanipal
0
187
Member Avatar for awah mohamad

"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].

Member Avatar for awah mohamad
0
707
Member Avatar for sergent

@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.

Member Avatar for sergent
1
276
Member Avatar for bigdan182

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 …

Member Avatar for bigdan182
0
159
Member Avatar for arlir

[url]http://sourceforge.net/apps/mediawiki/cpwiki/index.php?title=Pause_console[/url]

Member Avatar for arlir
0
115
Member Avatar for triumphost

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

Member Avatar for Ancient Dragon
0
551
Member Avatar for jingda

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 …

Member Avatar for TrustyTony
1
491
Member Avatar for babis87

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

Member Avatar for Salem
0
2K
Member Avatar for sadsdw

Perhaps something like this. [code] string line; while ( getline(file,line) ) { istringstream s(line); string word; while ( s >> word ) { cout << line << " "; } cout << endl; } [/code]

Member Avatar for sadsdw
0
507
Member Avatar for RAIMI

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

Member Avatar for RAIMI
0
113
Member Avatar for venomxxl

[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.

Member Avatar for venomxxl
0
540
Member Avatar for kalingaRHASTA

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

Member Avatar for Salem
0
261
Member Avatar for kamragunjan

[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.

Member Avatar for Salem
0
116
Member Avatar for Salem

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 …

5
88
Member Avatar for RAIMI

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

Member Avatar for RAIMI
0
306
Member Avatar for vinothcv

[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.

Member Avatar for Salem
-1
518

The End.