6,741 Posted Topics
Re: That function is kind of scary. What exactly is it supposed to accomplish? I'm reasonably sure I can show you a better way to solve the problem. | |
Re: >My question is, is F# a really good language, and whether it is useful to learn. It's a decent enough language, and I always advocate learning new languages when you can. F# is useful, to answer your question, but it's not a replacement for C#. >Is it used for software/application … | |
Re: [B]>The following document can help you migrate : >[url]http://siddhant3s.googlepages.com/ho...00000000000000[/url][/B] If I may, I'd like to comment on a few parts of that document. [B]>2.3.1 Depreciated Header Files[/B] The word is "deprecated". Depreciate means to lessen in value. Deprecate means to declare a feature obsolescent such that while it's still supported, … | |
Re: [B]>You should perhaps try this: >void* ptr=but_ptr+20;//this is good[/B] Perhaps [i]you[/i] should try it first. You have no excuse for giving an answer that [B]will never compile[/B] on a conforming C compiler. ArkM gave the correct answer (and corrected tux's misconception about casting malloc). Alternatively, you can cast the pointer … | |
Re: [B]>How true can my theory be?[/B] It's about as close to bullshit as an honest theory can be. Knowing a programming language doesn't make one a master programmer. Learning languages is a good thing, but it's only a small part of being a programmer. There are many harder things that … | |
Re: [B]>gives me a wierd symbol for the area?[/B] area is declared as a char, and cout is assuming you want to print a character rather than the integral value. Change [ICODE]char area;[/ICODE] to [ICODE]int area;[/ICODE] and you'll get a slightly more reasonable result. | |
Re: [B]>Either way, I don't know how I could trick or trap someone... ?[/B] jephthah was probably thinking about the occasional student who tries to get us to do homework by inviting everyone to participate in a "contest". | |
Re: Do you ever ask questions that aren't [b]easily[/b] found in the manual? | |
Re: [B]>#include <winbase.h>[/B] Remove that line. It's superfluous anyway as windows.h correctly includes winbase.h. | |
Re: [code=csharp] string assemblyPath = Assembly.GetExecutingAssembly().Location; string assemblyDir = Path.GetDirectoryName ( assemblyPath ); string soundsPath = Path.Combine ( assemblyDir, "Sounds" ); [/code] | |
Re: [B]>Even though the break is in it's right place![/B] Just because the compiler points to a line doesn't mean the error is on that line. In your case, you have a rogue [ICODE]do[/ICODE] keyword on line 102. Remove it and the code compiles. | |
Re: [B]>hello, first of all welcome[/B] Thanks, it's good to finally be a part of an awesome forum like Daniweb. Wait, something's not right here... [B]>this wont compile[/B] You have a rogue << at the end of your output statement. | |
Re: Treat it as a variation of K&R's atoi. You should already know that you can step through the string and add the characters like so: [code=c] result = radix * result + digit; [/code] If radix is 16, you're converting a hexadecimal value. Now all you need to do is … | |
Re: [B]>For the 20th value, if a 0 was not generated, load >a 0, otherwise get one more random number.[/B] So if 0 was not generated, it'll always be the 20th value? I'd suggest a final step of randomly shuffling the values. That way you get the required 0, but it's … | |
Re: [B]>I'm using Borland's TurboC++ 2006 Explorer. [/B] Then you shouldn't need a makefile, unless you're turning in just the source for your project. IDEs handle that kind of grunt work for you. [B]>The instructor doesn't like using the #include Definitions.cpp in the Driver.cpp file[/B] Wise of him. It's a bad … | |
Re: @OP: I'm sorry to say it, but so far tux has been unintentionally misleading you. Allow me to clarify. [B]>I've read that the bits in a byte (in c++) are implementation or system dependent.[/B] Yes. [B]>What does that mean?[/B] It means that you can't rely on a byte always having … | |
Re: >The ancient hebrew scripture and large sections of the bible are actually code. Any significant body of text will contain "hidden messages" that mean absolutely nothing and weren't intended by the original author. It's no different from how successful prophecies work: if you're vague enough, they apply to damn near … | |
Re: Agree 100%. Perhaps Dani can look into this as she aggressively filters the allowed advertisements on Daniweb. There's no point in making Daniweb's members angry with ads; that defeats the purpose. | |
Re: [B]>does the act of initializing that constant data member (providing it >with a value) actually stop you from assigning it the value you >wanted to give it later on in the program?[/B] No, the fact that it's const stops you from assigning to it after initialization. If you don't have … | |
Re: [B]>Just look at your keyboard and see which key is blurred most[/B] My keyboard is too new to have that kind of wear yet, but on my old keyboard D and J were the blank ones, with Enter, period, and semicolon coming a close second. | |
Re: 10 is typically the numeric value of '\n'. Enter is a character too, so when you type a character and then press Enter, that puts two characters on the stream. See if you can find the problem with that explanation of your output. | |
Re: It's pseudocode. It doesn't need to be perfect, it just needs to express your logic accurately. Oh, and do your own damn homework. | |
Re: >What is the MOST important thing to do when developing new code or modifying existing code Understand the problem to be solved, of course. This takes precedence over everything, including correct functionality. >Why? If you don't understand the problem, you can't possibly develop a new program or modify an existing … | |
Re: >By the way this is a C++ forum and not a C forum. Yes, yes it is. But printf and scanf are a part of C++ as well. It's not uncommon to drop down to stdio when iostreams are too slow. >We usually don't understand printf and scanf. Speak for … | |
Re: The same way, except instead of dealing with only two links, you have more than two (usually in an array). | |
Re: iter is invalid after calling erase, so you can't legally increment it. You need to be more careful about how you obtain the next iterator: [code=cplusplus] for (iter = gameList.begin(); iter != gameList.end(); ) { if (*iter == deleteGame) iter = gameList.erase(iter); else ++iter; } [/code] | |
Re: [B]>Lemme Tell you All About Me Before Yu All Pile On Me! Im Only 14! [/B] You're old enough to understand the basics of proper spelling, grammar, and sentence structure. [B]>Can Someone Exsplain Boolean (bool)[/B] The bool type is very simple. There are two states: true and false. Let's say … | |
Re: >when i tried aux=aux->prox ...aux becomes invalid because aux->prox is an uninitialized pointer. Any further use of aux, except to point it to another address, is doomed to failure. | |
Re: [B]>You also need to master the basics elements >such as generics, delegates, interfaces, etc. [/B] I'm a fan of generics, but I don't delude myself into thinking that they're required knowledge. You can get by without writing a single generic class or method and still be an non-novice. Laundry lists … | |
Re: [B]>>Foreach works on the string array, not on the function call. >yeah that is what i concluded and surprised.[/B] Right. No offense, but that's pretty obvious when you consider that the expression for foreach requires some form of enumerable collection. foreach is really just syntactic sugar that's converted to a … | |
Re: >I have to interview one-and my options are running out. Why don't you search the forum for similar interviews? Your questions are hardly unique. I know for a fact that I've thoroughly answered each of them for students looking to interview a programmer. | |
Re: >why doesn't this code work Did you define DEBUG? | |
Re: The fact that it's printing more than twenty numbers should be a strong indication that your condition for the loop in displayArray is incorrect. Specifically, it's written with a C-style string in mind, not an array of float. Try passing the size to displayArray like you do with setArray. That … | |
Re: [B]>Can you explain what is it: [I]binary search tree sorted with quicksort method[/I]???[/B] It's a poorly worded question. Clearly a binary search tree is already sorted by nature, so quicksorting the tree itself is nonsensical. By the looks of the code, the OP wants to copy the contents of the … | |
Re: Perhaps if you explained exactly what you were expecting and how what you got is different... | |
Re: >I use the Turbo C++ 3.0(dont judge it by graphics) as its easier to use. Then your outdated suggestions are likely to be useless to the majority of people here. C++ has grown since then, and most modern compilers will simply refuse to compile your code. | |
Re: Simplest solution: store the result values in an array, then traverse the array backward. | |
Re: >shu shu shu shut you mouth You can dish it out, but you can't take it? That's pretty sad. | |
Re: You've got a massive memory leak. Each time the loop iterates, you replace your pointer with a new block of memory. I imagine you wanted realloc instead of malloc: [code=c] #include <stdio.h> #include <stdlib.h> #define CHUNKSIZE 5 int main ( void ) { unsigned long *array = 0; size_t capacity … | |
Re: >Before anyone starts talking about mixing c++ and c, >I know it's generally a bad idea but std::strings are to slow. It's not generally a bad idea, but I'm curious why you think std::strings are too slow. Have you written your code using them, profiled it, and determined that the … | |
Re: >I accidently posted a thread meant for this forum >and got a tirade of abuse from "you know who". Please link to the thread you're referring to. Looking at your account, I see you've only started five threads, none of which contain any form of abuse. You've never received a … | |
Re: >because developers (who are not necesarily programmers) believe >that the hardware is so powerful that it will carry out any task This is an unfair generalization. Just like any field, software development has great variance in the quality of developers. There are a handful of gurus, a half-decent amount of … | |
Re: We can't create a forum for every language, but [URL="http://www.daniweb.com/forums/forum42.html"]this one[/URL] is a catch-all for the languages that aren't explicitly mentioned. VBA is sufficiently different from VB 4/5/6 to go there, but other VB questions are probably better suited to the VB 4/5/6 forum or VB.NET. | |
Re: No forum is exempt from moderation. Perhaps you should read and follow the rules instead of whining about it. | |
Re: 1) Functionally, in that situation, the two are the same. What you're seeing in the first example is C's comma operator in action. Occasionally you'll see people use it to avoid braces. Whether that's a good idea is debatable. 2) [URL="http://www.cplusplus.com/reference/clibrary/cstdlib/div_t/"]div_t[/URL] is a standard structure. Do you have a more … | |
Re: DarthPJB, it's a good idea to [I]not[/I] take iamthwee seriously, in pretty much every case from what I've seen. | |
Re: 1) Define a "thing" 2) Define "emit" 3) Define "vibration" Prove: * Show that all known things emit vibration. Disprove: * Display one case of a thing that does not emit vibration. | |
Re: The state of the stream and the contents of the buffer are separate. Even though you reset the buffer to a new string, the stream is still in an end-of-file state from the previous read. You'll notice that out_offset is correctly set to 3 because the stream starts off in … |
The End.