6,741 Posted Topics
Re: Why do so many students have trouble with round robin? It's not even a difficult concept, much less a difficult implementation. Yet every year (right around this time too), we're bombarded with one-liner questions by new members. | |
Re: >why? It depends. Where in the world do you think the hash<> template is coming from? | |
Re: >no matching function for call to `getline' You probably forgot to include <string>. | |
Re: >My problem is how to get the size of my array when its a dynamic array You allocated the array, you should know the size. In other words, there's no portable way to find the size of allocated memory given nothing but a pointer to it. You need to remember … | |
Re: >Why doesn't it look good? Because a lot of us visit most of those forums, and seeing an identical thread on each one reeks of spamming and trolling for answers. >I don't see what it matters where else I get answers. It doesn't matter. What matters is that by asking … ![]() | |
Re: I'd start by using an array instead of N separate variables. What you're doing makes it difficult to handle the list elegantly. As for your code, it's very screwed up. ;) Here's the pseudocode for your problem: [code] constant N := 5 numbers [0..N] of integer # Load the numbers … | |
Re: >helos...!!! >wel am new to dis..!!! >but i hav a code to it...!!! >lets try out..!!!!! You have one of the most annoying writing styles I've seen. If you want people to treat you like anything but an irritating script kiddie, use proper English. The non-native English speakers will thank … | |
Re: >I'm trying to get as many hits as I can to my website and I want to have >this program running while I'm not using my computer for other things. While not illegal, this is definitely unethical, and I'm reasonably sure most of us have a problem with your stated … | |
Re: >t2 = t1 + (2*60); // want a 2 minute timer >while( t1 < t2) How wonderfully pointless if you want a general solution. While time_t is an arithmetic type, the size and range are implementation-defined and contents are unspecified. The only thing you can assume is that you can … | |
Re: >so std::vector<bool> will occupy space:: number_of_elements*1bit?? No, [INLINECODE]number_of_elements * sizeof ( bool )[/INLINECODE]. The difference is that the size of bool isn't set in stone, and it's going to be at least sizeof ( char ) because char is the smallest addressable unit in C++. [Edit: Ignore the above. I … | |
Re: >error C2065: 'numz' : undeclared identifier Your code looks fine. Did you make any changes from what was posted originally? >warning C4267: 'initializing' : conversion from 'size_t' to 'int', possible loss of data You can ignore this, but it's a good practice to match the type of whatever values you're … | |
Re: >What do you guys think of the Sam's book? I don't trust any book that you can finish in 21 days, 24 hours, or 10 minutes or claims to be for dummies or idiots. They tend to gloss over important concepts (assuming the author is competent), but more often than … | |
Re: >anybody know an estimate of how much to expect to pay? My consultancy base rate is $250 per hour. That's fairly standard for high quality programmers, so if you want better prices, surf over to rentacoder.com and have the masses bid on your project. | |
Re: >How do I find data stored in a two dimensional linked list? Is this a hypothetical question, or do you really have to write such a function? My first inclination would be to count from 0 to row while traversing the outer list, then jumping into the inner list of … | |
Re: >Any help? Yes, plenty. But you'll have to make an attempt first. No effort on your part results in no effort on our part. | |
Re: >Is it possible to avoid the 26 rows if-else, and the horrible printf? Yes, if you're willing to generalize the solution and use up more storage to do it: [code] #include <ctype.h> #include <limits.h> #include <stdio.h> int main ( void ) { int lookup[UCHAR_MAX + 1] = {0}; int ch; … | |
Re: >void main (void) [INLINECODE]int main()[/INLINECODE]. No excuses. >while (in<2000000000 && in>-2000000000) What requirement brought this about? Anyway, you only read one number and proceed to work only on that number. You need to read another number inside the loop. | |
Re: If you're learning Java without a reference, get a reference. If you have a reference, READ IT! I mean, come on, how trivial does this have to be before you can figure it out on your own? Any book on Java will cover every single one of those questions. Not … | |
>How can i convert a number to binary in c++ If you stare at it really hard, things will start to blur and when you turn your head, it'll start to look like binary in your peripheral vision. | |
Re: You need a text editor that doesn't add formatting crap to the source files (which means Microsoft Word is out) and a compiler. If you're lazy (like me), you can get an IDE that combines a compiler and text editor (along with other tools). [url=http://msdn2.microsoft.com/en-us/express/aa700735.aspx]This[/url] is pretty user-friendly, but beginners … | |
Re: >This is not true data abstraction. Sure it is. The abstraction is the stack and its implementation, not the contents of the stack. Returning a copy of the top of the stack instead of a pointer to it makes no difference in how the stack works. Presumably the question is … | |
Re: >anyone have any experience with this? Bumping a thread is extremely rude and insulting to everyone because it presumes that your question is more important than all of the others when all questions have equal priority to those of us who are answering them. When someone feels confident in answering … | |
Re: Your main doesn't have a closing brace. You also can't have nested functions, so the use of even and odd in determine has to be done differently. | |
Re: If you want the character representation of a digit, wrap it in single quotes: [code] if (studentId[3] == '1') cout << "Freshman "; else if (studentId[3] == '2') cout << "Sophmore "; else if (studentId[3] == '3') cout << "Junior "; else if (studentId[3] == '4') cout << "Senior "; … | |
Re: How appropriately vague. Well, assuming quite a few things about the list because you didn't specify, the common convention is this: [code] for ( node *it = head; it != 0; it = it->next ) std::cout<< it->data <<'\n'; [/code] | |
Re: >A) is the way I used the string and new operator correct for this little program? It looks fine, why do you ask? >B) is this <bad Ptr> related to a bad Pointer and what does that mean? It's just your debugger's way of saying that mName isn't ready to … | |
Re: "Doesn't work" is the worst possible description of a problem. Maybe you should try being more specific. | |
Re: Well, you can start by telling us what your compiler and OS are. :icon_rolleyes: | |
Re: >if ( names1[i].score[i] == 0 ) score isn't a member of the std::string class, so you can't use the dot operator like this. You follow the same pattern quite a bit, but I'm not entirely sure I can anticipate what you were trying to do. | |
Re: In the swap step, you're swapping with maxIndex when you should be swapping with index. | |
Re: >Is it right?? In theory. In practice it's more like this: [code] *( *( baseAddress + N ) + M ) [/code] Why? Because a two dimensional array isn't required to be strictly contiguous in memory. Pick any teacher and they'll tell you that the storage for a two dimensional … | |
Re: >In a scenario where you had to choose between Operating Systems and Computer >Architecture, which would you have chosen keeping my field in mind? It really depends on what the operating systems class covers. Most likely it's going to be steeped in theory and minute details of OS design and … | |
Re: >The problem is that when I run the program instead of it showing >me the contents of the class file it just terminates. Probably because you've commented out all of the stub code that displays anything. The program isn't going to do something that you haven't written code to do. … | |
Re: Just like variables, functions have to be declared before you use them: [code] #include <iostream> using namespace std; [COLOR="Green"]float Omrekenen(float tempFahrenheit);[/COLOR] int main() { float tempFahrenheit; float tempCelsius; float Omrekenen; cout << "Geef de temperatuur in Fahrenheit: "; cin >> tempFahrenheit; tempCelsius =Omrekenen(tempFahrenheit); cout << "\n Dit is de temperatuur … | |
Re: >can anyone suggest any related topic with my degree in Software engineer. You just took the class for a whole year. How is it possible that you're incapable of picking a project that suits what you've learned? | |
Re: >In Visual basic express edition when I create a forms application I only get one file. That's because the IDE is hiding the rest of the files from you. There's a button on the solution explorer that disables hiding files. >I've heard a lot about the limitations of VB but … | |
Re: >#include <iostream.h> I'll let that slide because you're using a compiler that's roughly the same age as dirt. >#include <conio.h> This I won't let slide. You have no reason to use conio, and I'll explain why shortly. >void main() { I don't care if the compiler lets you do it, … | |
Re: >but its constructor is not called The constructor [b]is[/b] called, you just didn't define it. This: [code] obj() { cout<<"\n Is this constructor \n"; } [/code] is not a constructor. It's an ill-formed member function that happens to have the same name as your typedef. If your compiler doesn't warn … | |
Re: >%02.3f The field width is the total number of printed characters, not the number of characters before the radix. Try "%06.3f" instead. | |
Re: There's absolutely no context to your question, and as such, it's nonsensical. | |
Re: >I'm a hot woman from Holland, where are you.. You have 8 posts (presently) and most of them contain "I'm a hot woman". 1) Daniweb isn't a dating service. 2) It's creepy. 3) It makes you sound like a dude. 4) I feel my brain cells dying just reading your … | |
Re: The only part of the code you posted that the warning makes sense on is: [code] !isdigit(array[i]) [/code] And a cast can fix that, because isdigit expects an unsigned char value or EOF: [code] !isdigit ( (unsigned char)array[i] ); [/code] Post a more complete example that exhibits the problem, please. | |
Re: >So any way to adjust this terminal or anyway to keep the terminal size big? That's poor design. Your program's output should conform to the environment, not the other way around. There are ways to find out the size of the console, and you can use those rather than hard … | |
| |
Re: >So how would I access the Pizza data to output it? Probably define a member function or overloaded << operator that performs the output. In the code you posted, the Pizza class doesn't provide any way to get at the data. For example (keeping it simple): [code] class Pizza { … | |
Re: Are you still going on about being abused? Don't you have anything better to do than whine? Oh, and your thread is completely off-topic for this forum. | |
Re: >im 15 years old, i wanna learn c++ >lol I'm reasonably sure that "lol" doesn't count as punctuation in English. Anyway, I look forward to your presence on the C++ forum (it's always nice to see new faces), though I encourage you not to take anything personally. You'll find people … | |
Re: We're not going to debug your program for you without any hints. If there's something wrong with it, tell us. Include any error messages you get and a detailed description of what you expect it to do. And read all of our announcements and rules before posting again, please. |
The End.