5,331 Posted Topics
Re: Not enough information, which is why you have been down-voted. There are a lot of "standard books" that I wouldn't use to wipe... you get my meaning. Even f() is, in today's standards, an invalid construct since the lack of a return type defaults to an integer, and there is … | |
Re: I take it you are going to hold onto the string pointed to by p? Wny not make a copy of the source string as in a C++ string class object? In case you didn't know, I believe the string class uses a copy-on-write memory management algorithm, so if you … | |
Re: School work? Please don't ask us to do it for you! There are a lot of resources to research this on the web. Remember, Google is your friend! I did a quick search, and found the answer to your question in about 5 seconds... | |
Re: What does yum say are the package name/versions of the kernel, kernel-headers, and kernel-devel? Also, you need to boot into runlevel 3 (text mode) with the new kernel to install the nVidia drivers for it. | |
Re: Yes, there has been a lot of chatter on the boards (linuxforums.com for example) about this. My solution was similar, but different - I removed the nouveau driver altogether, along with any other installed nvidia pieces, switched to runlevel 3, installed the proprietary nvidia driver, and rebooted. Still, a real … | |
Re: [QUOTE=pseudorandom21;1506830]Please see this page for more algorithm information: [url]http://en.wikipedia.org/wiki/Quicksort[/url][/QUOTE] And if the poster is really clever, they will read the man page for the qsort() function... | |
Re: Actually, instead of exit() in mike_2000_17's code as "last resort", use ::abort() - that will generate a core dump and if your program was compiled with the -g option and not stripped, then you can do a post-mortem in the debugger and look at variables, stack, etc. Or, just run … | |
Re: [QUOTE=frogboy77;1507281]Does anyone actually know what the question is? Does the OP?[/QUOTE] Probably not, considering the non-existent quality of the "spec". As someone once said "If it was easy, anyone could do it."... | |
Re: Without seeing what you are doing in assign3.c, this is not helpful. Also, what compiler (include version) and platform are you building on? | |
![]() | Re: Get/Read Comer and Stevens "Internetworking with TCP/IP, Volume 3, Client-Server Programming". From what I am reading, you are just guessing what to do. On the client side, you open socket, bind it to the server address, connect to the server, then loop into send-message/get-reply. You can use select() on the … |
Re: [code] char buffer[500]; sprintf(buffer, "======================\nMonth : %d\n:Day : %d\n", st.month, st.day); [/code] | |
Re: The functions you use, like readdata() and printvalues() are in another translation unit (fancy name for source file or library). Normally you include the necessary headers where the functions are declared, and link the program with the object file or library that contains the implementation of the function. Something like … | |
Re: Each do loop needs a while condition, such as: [code] bool done = false; do { // Stuff to do if (no_more_stuff_to_do) { done = true; } } while (!done); // Or while (!done) { // Stuff to do if (no_more_stuff_to_do) { done = true; } } [/code] | |
Re: What mike_2000_17 said, plus this: [code] // Your code ----> p = &b; // Ok *b.l = 23; // Bad: member 'l' has not been initialized with a valid pointer *b.m = 23; // Bad: static member 'm' has not been initialized with valid pointer cout << "with ptr = … | |
Re: From your description, you are using 8-bit values, and want to extract the high and low nibbles (4 bits), turn them into 4-bit values, then add them together? Is that correct? If so, then what you want to is a mask and shift operation. Example: [code] unsigned char ch = … | |
Re: You can compile a completely empty source file, or one that only has preprocessor statements like #include, #define, etc. You will possibly get a warning, but it shouldn't be fatal. You are correct in that two main() functions would not be viable. Even c++ which allows function overloading (two functions … | |
Re: 1. Break your program into logical units as functions, such as the code for processing menu a or menu b. 2. As suggested, instead of a great big set of if/else statements, use a switch(). 3. If you want your program to be portable, don't use MS specific screen formatting … | |
Re: [code] void cubes(int n) { if (n >= 1) { cubes(n-1); cout << (n * n * n) << endl; } } [/code] | |
Re: Way too much cruft to sort through quickly here. Remember the motto "KISS" - so, simplify your code down to the bare essentials, and take all those big loops and refactor them into function calls. That way, each function point (call) can be much more easily analyzed in detail, and … | |
Re: In the class definitions, class Child is not derived from class Parent, at least in the example shown. IE: it should look like this: [code] class Parent { public: virtual void MyFunction() {// do something} }; class Child : public class Parent { public: virtual void MyFunction() {// do something … | |
Re: School exercise? First, state the problem clearly before you start coding. Second, write out the algorithm you are going to use as pseudo-code. Third, keep the actual code as simple as possible. Sieve: generate array of prime numbers. A prime number is divisible only by 1 and itself. The numbers … | |
Re: This is not helpful. You really need to provide the source code you are building for this, along with some description of what the application does (or that you want it to do), and what your design is comprised of. | |
Re: What happens if you remove the battery, plug in the A/C adapter, and turn on the system? If it still doesn't work, the motherboard is fubar. If it works, then the battery is kaput. | |
Re: Red Hat 2.x is a long-buried, dead corpse... Download and install current version 5.5 at least. If you don't want to pay the RH licensing fees, try CentOS - it is free and 100% compatible - only the logos have been changed. Go to [url]www.centos.org[/url] and download. | |
Re: Huh? Please explain better - provide some details about what you are trying to accomplish, and why. | |
Re: Each mobile platform has very different coding requirements. What device do you want to use? If you are interested in Android development, you can go to the google/android web site and download their SDK (software development kit) which includes an Android phone emulator. That way you can test out your … | |
Re: This has happened to me when I spilled water on my keyboard. It caused some of the carbon on the key contact to run and short out, resulting in repeating keys and/or the wrong key being detected. I had to replace the keyboard. | |
Re: Unfortunately it is true that many (if not most) hospitals are almost entirely Windows shops, even the systems that monitor critical medical devices. A number of them were effectively shut down recently when they were hit with a particularly nasty virus - only emergency operations in life-threatening situations were allowed … | |
Re: A wise decision? I think not. Microsoft has a wonderful track record, of sticking the knife in their partners' backs. This is one deal that Amazon will come to regret. That's just my humble opinion. | |
Re: The best thing to do is to study existing code, such as Amarok, VLC, etc. | |
Re: What Bob said. You don't want to keep reseeding the random number generator (which is what srand() does). Doing that, you can get rid of the sleep() function as well since that will not affect any of the calls to rand() inside the loop. |
The End.