6,741 Posted Topics

Member Avatar for rizoshar

First and foremost, don't ever use Robert Sedgewick's code. He knows his stuff when it comes to algorithms, he's a smart guy, and I recommend his books wholeheartedly for the descriptions and insights. But his code sucks ass! It's poorly written and often contains subtle or not so subtle bugs. …

Member Avatar for Narue
0
140
Member Avatar for <1337>Me</1337>

Both. I use Mandrake, FreeBSD, and Windows XP as my three primary systems. I also occasionally find myself working with HP-UX, various other versions of Windows, SUSE, Solaris, and MacOS.

Member Avatar for DimaYasny
0
157
Member Avatar for kv79

>Is new keyword in C No, it's just a variable. >and what about this? The author is telling you the steps for splicing a new node onto the front of a linked list.

Member Avatar for Narue
0
81
Member Avatar for sneekula

>What is your view or experience with this issue? Linux and Unix users tend not to run as a super user. Windows users almost always run as an administrator. The security debate is already skewed in favor of Unix/Linux because if you don't run as a super user, you've effectively …

Member Avatar for MidiMagic
0
631
Member Avatar for #include<DAN.h>

Find out the integer value of the character in your character set and you can use the hexadecimal or octal escape characters: [code=cplusplus] #include <iostream> int main() { std::cout<<"A == \x41, A == \101\n"; } [/code]

Member Avatar for Salem
0
125
Member Avatar for mr.cool

>why did i need the std:: before i cout Because every standard name is now placed inside the std namespace. To access one of those names, you have to get into the std namespace in one of three ways: The using directive to open up all names within the scope: …

Member Avatar for Narue
0
97
Member Avatar for kv79

>i always mix up a NULL and '\0' and 0. The short answer is that you use NULL with pointers, '\0' with characters, and 0 with everything else. The long answer is that '\0' and 0 are identical. In C they're both integers with the value 0. You can use …

Member Avatar for kv79
0
183
Member Avatar for peeta

The documentation will be your best bet for learning your particular implementation. For learning C++, you would be wise to stick to books that follow the standard language closely. "Accelerated C++" is a good choice.

Member Avatar for peeta
0
120
Member Avatar for Archimag

>NO LOOPS!!!!!!!! RECURSION ONLY! no FOR no WHILE....FORBIDDEN or the grade will be 0! Uh, I think we get it. You can't use loops. There's no need to go overboard. >Thanx a lot......... Well, you're not going to get any help unless you show some proof of effort. Post your …

Member Avatar for Archimag
0
161
Member Avatar for djJonno

The answer is yes. If the function is virtual, you can redefine it in Pigeon to do something different: [code=cplusplus] #include <iostream> class Bird { public: virtual void Amethod() { std::cout<<"Amethod from Bird\n"; } }; class Pigeon: public Bird { virtual void Amethod() { std::cout<<"Amethod from Pigeon\n"; } }; void …

Member Avatar for djJonno
0
279
Member Avatar for wega

What are you going to do with the contents of the file? How big is it?

Member Avatar for Comrade Ogilvy
0
105
Member Avatar for tehprince

Here's a hint. Given a character that represents a digit, you can subtract '0' from the character and get the digit value. '0' - '0' is 0, '1' - '0' is 1, etc... With that you can use this expression to build an integer value from a sequence of character …

Member Avatar for tehprince
0
98
Member Avatar for cheers4beer

>Would a text file be the most professional way to save the settings for an executable? Why wouldn't it be? If you don't need anything more sophisticated it would be unprofessional to push more of a solution than you require. >So, what kind of file is IE7 or most mainstream …

Member Avatar for cheers4beer
0
90
Member Avatar for cancer10

>Just wondering whats the difference between a Programmer and a Developer? The difference is how you label them. In theory a programmer doesn't do any of the designing for a project; he's strictly a code monkey. A developer is active in all stages of the development of software. In reality …

Member Avatar for Ancient Dragon
0
227
Member Avatar for Jishnu

>But, can we just add a feature so that after a certain >amount of time, the thread is not deleted, but it is closed? There's really nothing wrong with re-opening a discussion as long as it's relevant. The problem is bumping ancient threads with a "me too!" post, or to …

Member Avatar for Jishnu
0
60
Member Avatar for zawpai

>or it is suppose to be already included by the Windows.h header file? Headers only contain declarations. To get the definitions you need to link with a library (ie. Kernel32.lib or Kernel32.dll). Here's a poor man's timer: [code=c] #include <stdio.h> #include <time.h> void wait ( double seconds ) { clock_t …

Member Avatar for zawpai
0
157
Member Avatar for guy40az

>Could someone recommend a C++ compiler to write programs on a linux platform. [url=http://gcc.gnu.org/]GCC[/url]. It's probably already installed on your computer, too.

Member Avatar for Uncle_John
0
102
Member Avatar for temyreal
Member Avatar for jobs

>Ancient Dragon, sizeof(int *) and sizeof(int) just gives 4 bytes. On your machine. >That makes size since all memory location are 4byte long, well on 32 but machine. That's certainly a logical assumption. >Am i right? No, you're not. A pointer in C doesn't apply to any specific implementation, it …

Member Avatar for Narue
0
345
Member Avatar for driplet

>I need to convert a variable of single character to corresponding ASCII number. First, keep in mind that the world doesn't run on ASCII anymore. However, the char data type is also an integer type, so you can simply treat it as an integer and the problem is solved: [code=cplusplus] …

Member Avatar for Narue
0
455
Member Avatar for CaninA
Member Avatar for invisal

Hmm, close. >void (*ptr)(); Pointers to member functions have different syntax than pointers to functions. You need to specify the class: [code=cplusplus] void (A::*ptr)(); [/code] >ptr = &a.show; Member functions aren't stored internally in objects. You need a class resolution for this: [code=cplusplus] ptr = &A::show; [/code] >*ptr(); Non-static member …

Member Avatar for dubeyprateek
0
373
Member Avatar for jobs

A more detailed answer is that C doesn't really have a string type. Because there's no string type, we use arrays of char with a special character acting as the end of the string, and all of the rules for arrays apply. In other words, arrays aren't a first class …

Member Avatar for Narue
0
107
Member Avatar for haelly

>I need help to complete this program together with the interface What [b]exactly[/b] do you need help with? Your posts reek of a "do it for me!" attitude.

Member Avatar for ithelp
0
297
Member Avatar for ithelp

>do you also think that something should be done about >those who give out neg rep which was uneccesary? What do you suggest? Rep is subjective by nature, so how do you determine what is "unnecessary"? Not to mention that rep is intended as a fun little aside and not …

Member Avatar for Narue
0
309
Member Avatar for Backmat

Change [ICODE]#include "\\bandit.h"[/ICODE] to [ICODE]#include "bandit.h"[/ICODE]. That's more likely to be what your compiler is expecting. You also have a syntax error in the Bandit class' constructor definition.

Member Avatar for Backmat
0
108
Member Avatar for sitaag44

It takes a twisted personality to create multiple accounts so that you can answer your own questions. :icon_rolleyes:

Member Avatar for poiuy
0
110
Member Avatar for SimbaRider

Welcome, but we have a specific forum for introductions. If you have a question, go ahead and ask it.

Member Avatar for Jishnu
0
39
Member Avatar for ithelp

>What features would you like to add to /remove from C++? I can't think of anything off the top of my head that I would remove. Redesign perhaps, but not remove. Additions are a problem because the language and libraries are bloated enough as it is. My answer would be …

Member Avatar for Salem
0
116
Member Avatar for Jishnu

>What does Zw stand for? It's a mystery. The common assumption is that Zw was chosen because it meant absolutely nothing and there was little chance of something popping up that would make it significant. >I'm not able to understand this thing in the italics. Put simply, the Zw* versions …

Member Avatar for Jishnu
0
142
Member Avatar for varsha0702

>I don't agree with U. You can disagree all you want, but you're still wrong. >u can search "fflush" in MSDN! MSDN doesn't define the standard library, the C standard does. And the C standard says that calling fflush on an input stream is undefined. If your compiler happens to …

Member Avatar for Beair.GQ
0
134
Member Avatar for Bamirasta

>How do you get all the content of that file into your >string without it stopping after the first null.??? It's possible to store multiple strings in one block of memory: [code=c] #include <stdio.h> int main ( void ) { char lines[] = "this\n\0is\n\0a\n\0test\n"; int n = -1; int i; …

Member Avatar for Narue
0
91
Member Avatar for Jicky
Member Avatar for jasimp
0
50
Member Avatar for mjoshi

>I dont understand that behaviour. You're using fgets, yes? Don't forget that fgets also appends '\n' unless the buffer is filled completely.

Member Avatar for Narue
0
137
Member Avatar for george22_jk

ssharish, could you please go all the way and use complete English words rather than chatty abbreviations? There's no reason to use "u" instead of "you". Those who don't have English as their native language or aren't familiar with chat speak will have an easier time following your posts, and …

Member Avatar for Salem
0
176
Member Avatar for azalia

>Dont define the function within the function. >Its not a good programming practice Yep, it's not a good programming practice because nested functions are illegal in C. I wouldn't call a practice that completely fails to compile anything [I]but[/I] bad. ;)

Member Avatar for Narue
0
87
Member Avatar for Nick Evan

Actually, I was talking about that particular comparison (sub-human to historical mass murderers) rather than how far you can go on Daniweb, but that might spark conversation too. Just don't take it as an invitation to find out how far you can go. ;)

Member Avatar for briansmall
0
137
Member Avatar for haelly

>THANKS. For what? We're not going to do your homework for you, so unless you want to receive stony silence or smart-ass remarks, you'd best come up with a precise question (a verbatim copy of your assignment doesn't count) and proof that you've attempted to solve the problem on your …

Member Avatar for Narue
0
341
Member Avatar for rajatC

>what's its unit...seconds..milliseconds..microseconds.. >or depends on clock frequency...??? From a standard library perspective, you don't know. Everything after this point assumes non-portable things about your implementation. You can divide the result by CLOCKS_PER_SEC and get the result in seconds, but be sure to cast one of those operands to a …

Member Avatar for Narue
0
193
Member Avatar for ithelp

>You were spamming the forum through your signature >and avatar and that violates keep it spam free. Signatures are the correct place for self-promotion or solicitation, provided it's within reason. ithelp's signature is indeed within reason, though that particular discussion may have taken place before jwenting was promoted to moderator. …

Member Avatar for Narue
0
231
Member Avatar for xeption12

>I just do not understand what is the advantage of lists over arrays? Insertion and deletion are either equal to or better than arrays in terms of theoretic efficiency. Growing and shrinking a list falls out of the implementation, whereas you'd have to specially design a simulated array to change …

Member Avatar for Jishnu
0
109
Member Avatar for Tom Tolleson

"For Dummies" books are dumbed down so much that it's virtually impossible to properly learn a technical subject like programming from them. What's worse is that the authors themselves tend to need further instruction before they're qualified to teach. In other words, "For Dummies" books are written for dummies, by …

Member Avatar for ~s.o.s~
0
202
Member Avatar for vmanes

>has anyone found any significant differences in the VS IDE or >how C++ programs compile, compared to the 2005 version? The IDE is about the same. It's been tightened up in a few places and flows a little better, but all in all it has roughly the same feel as …

Member Avatar for Ancient Dragon
0
119
Member Avatar for khenzel

>any assistance would be great! You neglected to mention what problem you're having. >i'm trying to get my class to point to the array that i have built inside the main function: That's a very bad idea. When classes don't have control over the memory for their members (either directly …

Member Avatar for khenzel
0
120
Member Avatar for eesti44

>Memory models(header files and so on) Memory models isn't usually a term that applies to headers. "Memory model" typically refers to the rules one has to follow (at an extremely low level) to properly use the memory addressing scheme for the system. >It seems a bit too scattered to me. …

Member Avatar for Jishnu
0
106
Member Avatar for superjacent

>"invalid conversion from 'const double*' to 'double' You mean "invalid conversion from 'const double*' to 'double*''". It's a significant difference, and the error is telling you that you're throwing away the const qualifier without a cast, which is illegal. It's coming from assigning begin (a pointer to const double) to …

Member Avatar for superjacent
0
151
Member Avatar for balla4eva33

>I want this to return NULL if the needle string is not found >in the haystack string and otherwise return the pointer to >where the needle is returned. You're in luck, that's precisely how strstr works. >I was hoping someone could help me find a way to implement it as …

Member Avatar for balla4eva33
0
223
Member Avatar for savinashr

Daniweb has an IRC channel. You can get to it indirectly through your favorite chat application at irc.daniweb.com, or you can click the "IRC Chat Network" button near the top of the right hand list of navigation links on every page.

Member Avatar for jwenting
0
136
Member Avatar for Symbolite

>I don't know what it wants me to do. >error C2660: 'findLow' : function does not take 0 arguments >error C2660: 'calcAvg' : function does not take 0 arguments Maybe, just maybe, it wants you to pass arguments to findLow and calcAvg? The big problem is that getValues doesn't have …

Member Avatar for Lerner
0
96
Member Avatar for wijitha

char and byte are basically synonymous: [code=cplusplus] unsigned char array[SIZE]; [/code]

Member Avatar for Narue
0
60

The End.