6,741 Posted Topics
Re: It's generally a good idea to establish a context before asking a question. Your question looks more like it should be a reply to an existing thread than the starting post of a new thread... | |
Re: >I believe the problem is somehow with while(infile), >ie, I dont believe I understand exactly how it works. Your intuition is correct. [ICODE]while ( infile )[/ICODE] is using infile's implicit conversion to void* to check for an error state. If the conversion returns a null pointer, it means the stream … | |
Re: > what is the best way to overclock your processor The best way to overclock your processor is to realize that overclocking doesn't do as much as you may think, and usually has detrimental effects. Then you can perform a safe upgrade that actually makes a difference. :rolleyes: | |
Re: I don't understand what you want to do. Can you be more specific? | |
Re: >I wanted to know, why is this, why do these two >commands some times work and sometimes don't' My initial guess is that they're in the wrong order. You clear the stream buffer first, then pause, not the other way around. If you really want the nitty gritty, try [url=http://www.daniweb.com/forums/thread90228.html]this … | |
Re: What have you tried? It looks like a fairly simple sequence that would be translated into an equally simple loop. | |
Re: >Does anyone know how to delete a specific index of an array? The only way is to overwrite it by shifting every element after the one you want to delete over it. For example: [code=cplusplus] for ( int i = to_delete + 1; i < n; i++ ) array[i - … | |
Re: >I think the address book needs a place for a fax number... I think life will be better when we stop using (and have to stop being compatible with) that obsolete technology. | |
Re: vze2zv5v, we're not a homework service. What you're doing is cheating, and nobody here will help you do it. I'm closing this thread. Please don't start another unless you start doing your own work. | |
Re: >What is the solution for this? Rewrite the program using a modern graphics library. graphics.h is an ancient graphics library for an ancient compiler designed to run on an ancient OS. I believe Salem said it best: You're trying to put a rubber band engine in a Ferrari. | |
Re: >Could you tell me a reason why this is happening? name and acc_type are uninitialized pointers in main. You're trying to write to memory that you don't own, and the compiler seems to think that's a bad idea. :rolleyes: | |
Re: >but when i try to append to the file, it will not do it Won't do what? Append to the file at all? Or it won't print the second line? | |
Re: >Can anyone tell what cause the run time "Debug Assertion Failed!" error message? Usually it means you caused a library function to break by doing something that it's assuming won't happen. This can also happen in your own code if you use assertions (which is rare, sadly). Step through your … | |
Re: >For eg, we can make an instance of the type tree >because we have the statement typedef struct tree. C++ does that automatically. You don't need to use a typedef. >banyan is just an instance isnt it? banyan is a synonym for struct tree. | |
Re: >The site design is beautiful, but counter productive for the forums. IIRC, Dani has spent a lot of money coming up with a user-friendly design. Suggestions are certainly welcome, but keep in mind that you're not the only user. >I think a good forum index should have it all in … | |
Re: >What are the reasons that geeks do not feel like renting signature links ? Probably because geeks tend to have more pride than that. | |
Re: Yes, assuming this is C you would use sprintf or something equivalent to format the points into your string: [code] char buffer[100]; sprintf ( buffer, "Total points: %u", points ); MessageBox(hwnd, "You have bla bla", buffer, MB_OK); [/code] | |
Re: >but I think this tool is very easy to write. It looks very easy to write, even for a beginner. >Please do me a favor. If you're asking us to write it for you, forget it. We're not a programming service, we're a programming help forum for programmers. We help … | |
Re: A stringstream is still a stream. You can seek on it: [code=cplusplus] #include <iostream> #include <sstream> int main() { std::stringstream sin ( "123456789" ); int value; sin.seekg ( 2 ); sin>> value; std::cout<< value <<'\n'; } [/code] | |
Re: >in the <bitset> library,can i convert any number system to another? Not directly, but you can use predefined stream manipulators and bitset to get conversions between binary, octal, decimal, and hexadecimal. However, if this is for homework, this solution probably won't be acceptable. >1)can someone be kind enough to explain … | |
Re: >I initially thought LIST was included in some C++ library It is, but it's called list rather than LIST. >I thought that C++ automatically "sums" lists somehow Yea, C++ supports that with the library too. It's called accumulate. >Thoroughly confused as usual I'm not entirely sure what you're asking for … | |
Re: >using only simple codes like length, size, adding, and subtracting. Loop through the string and print non-whitespace characters. When you get to whitespace, skip the whitespace, go to a new line and repeat until you get to the end of the string. | |
Re: >This site is bogus... It would be if we ever claimed to be a homework service. We never made that claim, so calling us bogus because you failed to read our rules is kind of stupid. | |
Re: >writer<<name[x]; //i know this isn't correct,, just to show what i m trying to do Actually, that is correct, provided you overload the << operator for your class: [code=cplusplus] class Name { public: set(int, string, string); friend ostream& operator<< ( ostream& out, const Name& obj ) { return out<< obj.id … | |
| |
Re: >Do I look for a programmer who works in C or in Java? Or does it matter? It really depends on what the application is going to do. One thing I would ask is why are you trying to force the choice of language on your developer when you seem … | |
Re: It's hard to offer suggestions without knowing what you've already tried. Post some code using the sort method so that we have an idea of what you're trying to accomplish. | |
Have you ever gotten something completely and utterly random stuck in your head? That's what I have right now, just a gibberish phrase that came out of nowhere and won't go away: yaba yaba poi gatau. | |
Re: The only one I know of is absolutely ancient, and it doesn't seem to be available on MSDN anymore. There are plenty of books on the subject, but if you want online freebies, you'll have to do some netdiving on google. | |
Re: >I'm sorry I don't speak english (only french) but I understand when I read it... This is a good chance to practice. If you can read English, you should be able to write passable English as well. We won't hold it against you if your written English isn't perfect, but … | |
Re: [code=cplusplus] class lowercase { public: int operator () ( int c ) { return tolower( c ); } }; [/code] [code=cplusplus] std::transform( s.begin()+1, s.end(), result.begin()+1, lowercase() ); [/code] *gives Duoas a cookie* | |
Re: >Simply doing the following does not seem to work because it returns a runtime error #2 I have no idea what your compiler thinks runtime error #2 is, but you can't assign a pointer to an array, which is precisely what you're trying to do with [ICODE]myArray = new int[i_Count];[/ICODE]. … | |
Re: Have you tried a book store? Or a library? If this book is freely available [I]legally[/I], have you searched for it on Google? | |
Re: >please why you did not tell me the solution I told you why in the thread that I closed. We are not a homework service. We don't give away complete solutions. Is this so hard to understand? >becaues i want this solution. I don't care what you want. >realy i … | |
Re: >y= double sin double x; That's nonsensical. Perhaps you meant: [code=cplusplus] y = sin ( x ); [/code] >cout << x << \"t" << y << endl; You accidentally flipped the \ and ". It should be: [code=cplusplus] cout << x << "\t" << y << endl; [/code] | |
Re: >Write a C++ class that implements all the functions >of an ordered dictionary using (2,4) tree??? Hmm. >Needs me for today Bwaahahahahaha! Well, nobody here is going to give you the code, so let's see what the chances are of you actually finishing your project: You posted one hour ago, … | |
Re: >Which files are needed to run assembly program? You need an assembler and possibly a linker to turn your program into an executable file. Assembly source is just a text file, there's nothing special about it until you assemble it into machine code. | |
Re: We're not a homework service. Don't expect anyone to give you code without any effort on your part, because that defeats the purpose of this forum, which is to teach and guide. | |
Re: >Is that possible? Yes. Direct your research toward distribution sorting: counting sort, radix sort, and bucket sort are examples of this method. | |
Re: [QUOTE=Ravenous Wolf]is there a benefit to knowing the classical data structures and algorithms despite the fact that they are incorporated in java api and dot net framework and someone might at any moment do the same for c or c++?[/QUOTE] I can't imagine the comfort level of being handed everything … | |
Re: >So are spaces and null characters similar? No, not at all. >how can i differentiate between the two You don't need to differentiate between the two. You need to figure out why your code is stopping when you don't think it should. We can help, but you need to post … | |
Re: Can you describe the number? Something completely (pseudo)random? A unique ID? A sequence number? What you're using it for determines how you generate it. | |
Re: >scanf("%d",p->id); p->id isn't a pointer, you need to pass the address of the object rather than the value: [code=cplusplus] scanf("%d", &p->id); [/code] You also have a second occurrence of that problem in print. Though I have no idea why a print function is taking input. :-/ [edit] On a side … | |
Re: >I'm going to flag YOUR post a BAD POST. Thanks for the report, but "Flag Bad Post" doesn't mean you think the post is poor in some way, it means that you think it breaks the rules defined [url=http://www.daniweb.com/forums/faq.php?faq=daniweb_policies]here[/url]. >You didn't help at all. He helped you spell a name … | |
Re: >There is any thing wrong?????? Yes, you forgot to add code tags despite having instructions thrown in your face with every post. I've added them for you this time. | |
Re: Have you tried anything yet? We tend to expect at least a tiny amount of code that proves you've made an honest attempt. | |
Re: >Is there a member function from the ios class? Sadly, no. >Would anyone show how to delete a specific line from a txt file? Copy the file line by line and ignore the line you want to delete. Then delete the old file and rename the copy to the original. … | |
Re: Take a close look at addcomplex and subcomplex. What value are you returning? |
The End.