6,741 Posted Topics
Re: >that basically doesnt run and gives alot of errors That's no surprise. remainder is neither a keyword nor an operator, so the compiler looks for an identifier that you've defined. Because you haven't done so, an error is thrown. You also haven't defined year, so the same problem exists for … | |
Re: I earn my gold in game, as any self-respecting player does. People who buy gold are almost as bad as the farmers who hurt regular players to sell it. | |
Re: With the way you have it set up, you can add an array declaration of the same name, remove the declarations for your items, and then everywhere you use item[I]n[/I], replace it with item[[I]n[/I]]: [code]#include <iostream> using namespace std; int main() { int item[5]; int sum; cout<<"Enter five integers: "; … | |
Re: >i dont know how to do it Not even a guess? You haven't tried anything and simply gave up? If so, programming is not for you. Otherwise, show us what you've tried. Tell us what you learned from what you tried. Show us that you're making some attempt at solving … | |
Re: >we should be able to append file1 anywhere in file2 Append? Or insert? Appending always adds new data to the end of the file, but inserting can add new data anywhere in the file. Appending is easy because C and C++ support an open mode for files that strictly appends: … | |
| |
Re: A system crash is when some software exception causes the system to panic and terminate. A system hang is when you get have form of infinite loop that takes up all of the CPU's time but doesn't cause it to terminate. | |
Re: Don't you think a hardware forum would be better suited to your problem than a software development forum? | |
Re: >what are the two issues involved with multiple inheritance? There are a lot of issues with multiple inheritance. :) >i know of one, the diamond problem, what's the other? The one you're probably thinking of is ambiguity caused by inheriting the same name from two or more classes. | |
Re: You can play games with modular arithmetic to avoid adding another variable, but sometimes it's just easier to count how many numbers you've printed. When you get to 3, print a newline and reset the counter: [code] #include <iostream> using namespace std; int main() { int x, n = 0; … | |
Re: >operator= can only be a member function. Correct. >It is intimately connected to the object on the left side of the =. Yes, but not so intimately (ie. constructor or destructor) that a non-member function is completely illogical. You could, if C++ allowed it, do this, and nobody would question … | |
Re: If you don't know how to create a shortcut, are you really ready to start developing software? | |
Re: >cin.sync(); // purge any \n This non-portable. From a standard perspective, it's also nonsensical for sync to discard the contents of the buffer. I've discussed it at length [url=http://cboard.cprogramming.com/showthread.php?t=66099&highlight=sync]here[/url]. [code] cin.ignore ( 1024, '\n' ); cin.get(); // wait [/code] Magic numbers should be avoided: [code] #include <ios> #include <limits> cin.ignore … | |
Re: [url]http://www.cygwin.com/[/url] | |
Re: >Is there someone who could help me convert this to Tasm style. I'm curious why you asked us instead of the original author on alt.lang.asm. But if you insist on doing things the hard way, your best option is to learn enough TASM to notice the differences and the similarities. … | |
Re: Get an assembler, get a quickie tutorial, and get going. I think that NASM is the easiest to get started with: [url]http://webster.cs.ucr.edu/AsmTools/NASM/index.html[/url] As always, if you have any questions, we'll be here. :) Once you get up and running, I'll be happy to show you how to interface with the … | |
Re: >IntelliTXT, AdSense, I can never win Rule #1: People will always find something to complain about. :) | |
Re: >I'm studying C++ using the same book and I found myself in a bit of a jam with that particular exercise. This thread is two *years* old. If you have a question, start a new thread rather than resurrect one that's already begun to decay. We can't stand the smell … | |
Re: My honest opinion is that you shouldn't be teaching something you only have a partial understanding of. ![]() | |
Re: >how to create a program that has portability to work in both platforms, windows and linux. Write 100% standard C++, or conditionally compile two different programs customized for the two operating systems. >which function we use to round a double to the nearest int number? You'll need to write it … | |
Re: >i learn abt c and c++ can u show me the big differences between 'em?? They're two different languages, the differences are quite numerous in syntax, semantics, and practical use. It seems like someone has been teaching you the "C++ is C with classes" BS. | |
Re: >am I doing a good job as site administrator? No, you're an evil and incompetent forum nazi, and we all hate you more than lawyers and politicians. ;) | |
Re: >*what is the advanyages and desadvantegs of the double linke list Is this homework? A double linked list allows you to move foward and backward, thus simplifying and optimizing some operations. However, the maintenance of the extra pointer complicates the algorithms. >*when we use the double and when we use … | |
Re: Welcome! What assembler are you using? Are you working directly with the Win32 API for assembly GUI applications or are you actually doing something fun? ;) >I used to write in C and C++ but didn't like the code bloat. Most of the bloat comes from poorly written (or clearly … | |
Re: >I have attempted to complete this but I cannot get it to compile. Probably because the code is some weird bastardization of C++ and Java. | |
Re: >When I assign the NULL character NULL isn't a character, it's a macro representing a null pointer. This is a casualty of the multiple meanings for the word "null". Use '\0' for a null character and NULL for a null pointer, or 0 for both if you want to be … | |
Re: ><snip angsty whining> I am supposed to read numbers out >of a file piano.data and put the results into report.out. How are the results to be formatted? Give us an example run of the program. >The piano file is structured like this Exactly like that? Or are you adding your … | |
Re: You have too many posts to be completely ignorant about code tags. Next time I won't bother adding them for you, and you can live with nobody helping because your code is unreadable. Or I might just delete the thread. | |
Re: >i cant fint it anywhere Then you weren't looking very hard. In about 3 seconds, I opened my browser to [url]www.google.com[/url], typed "matrix arithmetic", and was bombarded by pages and pages of relevant links. | |
Re: You'll get no help by posting partial code and complaining of a vague segmentation fault. If you don't clarify your posts, I'll remove them as spam. Also, for the same problem, keep your posts to a single thread. | |
Re: I'm impressed. That's a beautiful example of how not to program in C. | |
Re: >any ideas? Can you narrow it down just a tad? :rolleyes: | |
Re: cin.get only gets one character. If there are more than one characters in the stream, the pause won't work the way you want. Try this instead of a direct call to get: [code] #include <limits.h> void pause ( const char *msg = "" ) { cout<< msg; cin.ignore ( INT_MAX, … | |
Re: >But after printing the last word, it just hangs like as if expecting another string too. Probably because it's expecting another string. A newline is whitespace too, and unless you're terminating the loop with Ctrl+Z (or a read error occurs), it'll just keep asking you for another string. If you … | |
Re: >Is the code below ok? It depends on the definition of your types (which is confusing because they all seem to be the same thing) and what exactly you're trying to do. When you merge, do both lists have to remain unchanged? Generally, this is an acceptable merge: [code] struct … | |
| |
Re: The trick to learning is to just keep working with things over and over until they begin to make sense. I wouldn't expect anyone (certainly not myself ;)) to understand even a simple programming concept right away, especially if they don't have a good point of reference to relate to … | |
Re: >Is it possible running a sound in a console program? What does google tell you? | |
Re: >Is this an appropriate forum to ask for this kind of help? Not really. The best forum on Daniweb for your request would be IT Job Offers. However, if it's not a terribly complicated script, we can help you in this forum to learn enough Perl to write it on … | |
Re: >deprecated, I think that's how its spelled Yes, that's how it's spelled, but iostream.h is not deprecated. Deprecated is a term for an obsolescent feature of the standard that may be removed in a future revision. iostream.h was never a part of the standard, so it cannot be deprecated. It's … | |
Re: If I understand correctly, you're doing this: [code] C:\>Test Tekstfile [/code] Try this instead: [code] C:\>Test Tekstfile.txt [/code] | |
Re: >quick reply would be appreciated thanks That's not going to happen. You haven't provided enough information for us to adequately help you, so you can't expect even a rudimentary suggestion. You've also not given any code that proves you've made an attempt, so nobody will post any code to help … | |
Re: >I think that having so many forums and subforums levels >deep just is so incredibly confusing and overwhelming to new visitors. I'm having flashbacks to when I argued unsuccessfully on this point. ;) It's good to see you coming around, Dani. >Yes? No? Maybe So? Hell yes! But please consult … | |
Re: They're both fairly easy to implement. Why not write them both and do a test? | |
Re: >Also can u help me find a good reference on how to efficiently use Turbo C/C++ Get a newer compiler, your braincells will thank you. A good free one is Dev-C++. Another decent free one is Borland C++ 5.5, but it doesn't come with an IDE. | |
Re: >and just out of intrest was wondering about it's time complexity Um, O(N). Loops are what you look for primarily when working out time complexity, and since there's only one loop, it's pretty straightforward. | |
Re: >Which is right? Both. Any decent processor will show that shifts are faster, but the Pentium 4 is gimped in this case. | |
Re: Please don't resurrect two year old threads. | |
Re: >it would be nice if i could just use one socket for listening on several ports. Too bad it doesn't work that way. You have to have multiple sockets to listen on multiple ports, whether it be something like an array of sockets in the thread, or multiple threads that … |
The End.