6,741 Posted Topics
Re: >He can write a kernel, but programming a Graphical Interface is too difficult ... Two completely different things. Though the way the question is worded makes me think of a l33t h4x0r script kiddie with no clue at all about how complex an operating system is. | |
Re: >void main() int main() >if((StringPtr = new char[26]) == NULL) This may or may not correctly handle errors depending on how old your compiler is. >*(StringPtr+i) = String[i]; You know, you can do [INLINECODE]StringPtr[i] = String[i];[/INLINECODE] too. It's a lot easier to read and write. >cout << "StringPtr = " … | |
Re: >What does that mean?? erase modifies the string, but your string is const. Well, that's not what the error means, but it's the root cause. ;) | |
Re: The translation of your error is that std::map doesn't support random access iterators, and random access iterators are required for std::sort to work. However, std::map is already sorted on the key, so there's no need to explicitly sort anyway. | |
Re: >What are and how do I use vectors ? Vectors and arrays are conceptually analogous. Due to operator overloading, you can use a vector in much the same way you use an array, with the added convenience of built-in functionality like automatic growth and useful information rolled up into a … | |
Re: >how do i typedef a structure The method I usually see is a compact one: [code=c] typedef struct foo { /* ... */ } foo; [/code] But you can do it your way as well (though note you have a spelling error in the typedef; it's MyStructure, not MyStucture ;)). … | |
Re: Hmm, this spring doesn't seem very interesting anime-wise. The only one I'm truly looking forward to is Corda d'Oro, but that appears to be more of an epilogue than the second season that fans really want. >Dragonball Kai Dragonball Z without all of the time-wasters? Who wants to bet that … | |
Re: What's the problem again? You've pretty much got everything you need. | |
Re: >Could anybody tell me what happen? You don't know how to properly declare an array in C++: [code=cplusplus] int main() { int maze_size=5; int oppo_pos[3][2] = { {maze_size-1,maze_size-1}, {maze_size-1,0}, {0,maze_size-1} }; return 0; } [/code] | |
Re: >It's really freaking complicated Well, duh! ;) It's not as complicated as some people (who haven't learned it and base their opinions on anecdotes) would have you believe, but programming is hard, and assembly is programming without any sugar coating[1]. >so do any of you know of any good tutorials … | |
Re: If this [I]isn't[/I] one of those obvious paired spam questions (one account asks an "innocent" question and another answers it with an advertisement), it'll attract spammers anyway. /thread | |
Re: >Try converting the value using static_cast<int>(yourvalue) ... Casting is the worst possible reaction to an error like this. Putting a dirty plate in a stack of clean plates doesn't make it clean. | |
Re: This thread is being closed due to violation of Daniweb's homework policy. Read our rules, try it yourself, and then create a new thread if you need help (help != handouts, by the way). | |
[url]http://www.daniweb.com/forums/thread184342.html[/url] It seems AD is seeing something similar to me, but that thread is horribly messed up. I'm viewing it with Firefox 3.0.8 and words can't really describe the jumble of images and formatting that's all wrong. | |
Re: >It seems he's declared... a pointer that is also a function? Nope, it's a function that returns a pointer. The closest thing to a pointer that's also a function would be a pointer to a function: [code=c] void (*fp) ( void ); [/code] | |
Re: >so who should I believe? which team should i join? You should get all of the facts and form your own unbiased opinion. Mindlessly following one group or another is silly. | |
Re: I haven't received enough feedback to confidently say if [URL="http://www.eternallyconfuzzled.com/tuts/datastructures/jsw_tut_linklist.aspx"]this[/URL] is a good enough and detailed enough article, but I'll suggest it anyway. | |
Re: Start by looking at the code for an open source browser. If you want to write it from scratch, you've got your work cut out for you. | |
Re: >can you help me with xml coding with that attached file? XML is a hierarchical data modeling language. The image you gave shows nested data in the blocks to the right, so this: [code] +-----------------+ | | | baz | | | bar +-----+ | | | baz | | … | |
Re: Please provide a context as your question is otherwise impossible to answer adequately. | |
Re: > tree_node* root; //???Is this creating pointer root to first node???? Yes, it's the root of the whole tree. >root = NULL; //???start with empty binary search tree???? Correct, though an empty tree doesn't have to be just a null pointer. Often[1], you'll see trees with a dummy root for … | |
Re: Let's start by clearing up an obvious misunderstanding about pointers. >char *str; >fscanf(inp, "%s", str); This is broken. An uninitialized pointer does not mean a pointer to unlimited space. It means you're not allowed to dereference that pointer or compare it to anything until you initialize it. You still need … | |
Re: >I don't understand how it's done. The best way to understand recursion is to walk through a small example manually. Follow your code step by step with a pencil and paper, working on the logical tree you've already provided: [code] 6 / \ 4 7 [/code] [code] root = 6, … | |
Re: Did you try opening the header file and reading it? That's what I generally do. ;) | |
## Before You Ask ## - Read our [Forum Rules](http://www.daniweb.com/community/rules). - Engage your brain! We understand that running into a problem can turn off the rational centers of the brain, but please sit back and think for a bit about your problem before running off to find help. All too … | |
Re: I think it's rather arrogant to believe that global warming is mostly our fault (or that we can "fix" it) when there's evidence of several extreme planet-wide climate changes in both directions long before humans were around. I saw the snowball Earth theory on TV as well quite a while … | |
Re: Read [url=http://www.daniweb.com/techtalkforums/misc.php?do=bbcode#code]this[/url], please. | |
Re: >but what's so wrong about it? Destructors aren't called when you use exit. It's not a C++ friendly function. | |
Re: >If people's choices are hurting others then yea, it is our >business, and we can tell them how to live their lives >When it endangers other lives. Of course! And naturally you're qualified to make that choice. :icon_rolleyes: Tell me, have you ever thought to ask a smoker not to … | |
Re: I've neither written nor worked with such software, but I imagine it works something like a spam blocker by looking for fuzzy patterns or by comparing patterns from trusted code. I'd personally trust my eye more than plagiarism software. When you've been reading code for long enough, you can easily … | |
Re: >would it be an acceptable practice to make a header with all of the >variables that will be used in many methods defined as extern You're substituting one problem for another. In this case, the inconvenience of passing data around versus the nightmare of global variables in all but the … | |
Re: CancelAsync should work as long as your worker checks the CancellationPending property on a regular basis. | |
Re: push and pop are std::queue's equivalent of enqueue and dequeue, respectively. | |
Re: Have you looked into the standard library? There's a std::unique and std::unique_copy function. | |
Re: >I don’t know how to add + operator. Liar. Aside from not terminating the DistSign class (which I assume is simply a copy/paste error), your overloaded operator works just peachy. It can't be used as an rvalue because it returns void, but that's a design decision, not an "I don't … | |
Re: >Can somebody help me? I don't know what you've covered so far in your class, but I would use a template for this kind of variance in return type. | |
Re: >why it does not show the title for tape. It does, but the title happens to be an empty string. You're suffering from the problem described in the first paragraph of [URL="http://www.daniweb.com/forums/thread90228.html"]this sticky[/URL]. >what is the meaning of 1000 in that function? The first argument is a maximum limit, it … | |
Re: >How do we determine the value of n? If you can't use dynamic memory (and I'm assuming any alternative that uses dynamic memory, like std::vector), your only option is to make the array large enough to handle any reasonable number of records: [code=cplusplus] int P[1000], T[1000], V[1000]; [/code] Of course, … | |
Re: >How you can use cin.ignore to ignore every character >up to and including a specified character I'd start by reading my reference manual and seeing that the second argument to ignore is a delimiter. >I have written a program but it does not work the way I would like to? … | |
Re: Since this is extremely likely to be yet another attempt at starting a new thread with the same question, I know exactly what it is you want. But I'm still going to make you explain your question. | |
Re: You're not handling the default cause of a non-code. Since the first letter is 'm', and there's no substitution for 'm', your output is correct. | |
Re: It's never too late to start, but the game industry is incredibly competitive, so four to six years might be unrealistic for the dream job, depending on what exactly you want to do. However, getting into the industry is certainly doable. >Also, just wondering how hard the math really is? … | |
Re: >it fascinates me that more people dont use it! I can't imagine why. Pretty much the entire reason Linux exists at all is political infighting among the alternative vendors at the time. Why is it so surprising that vendors with an existing foothold aren't budging much when Linux comes around? … | |
| |
Re: >int sort(double top, double middle, double bottom); >{ Notice the semicolon before the opening brace in your function definition. You need to remove it. >double top, middle, bottom, temp; top, middle, and bottom are function parameters, you shouldn't redefine them as local variables. Compare: [code=cplusplus] int sort ( double top, … | |
Re: I think I prefer the code from the site ArkM gave you. ;) | |
Re: It's a feature of C++/CLI, so yes, it's pretty much restricted to Visual Studio. | |
Re: You'll need to read the chapter on classes and objects again. You clearly didn't understand it sufficiently to write any code. Once you figure out the relationship between objects and members, you'll be able to clear up the majority of those errors. | |
Re: >int i, count; You're not initializing count to 0, so when you increment, it starts at whatever garbage value was already in memory. | |
Re: A two dimensional array is not the same type as a pointer to a pointer. If you want to pass a two dimensional array, change your function to accept the correct type. If you want to pass a pointer to a pointer then pass the correct type. So what is … |
The End.