15,300 Posted Topics
Re: try this switch(x%2) { case 0: // even default: // odd } | |
Re: >The fade effect has been disabled since early yesterday, Oh really ?? Everything still fades when the mouse hovers over an ad on Chrom. | |
Re: In c++ the best way to avoid pointer problems is not to use pointers, or use smart pointers. Instead of writing your own linked list algorithms use std::vector (arrays) opr std::list (linked list) and those classes will handle all the pointers. | |
Re: Just replace the line 15 with this: `cout << space << '\n';` | |
Re: f and g are the same question. You didn't answer h i is ambiguous. If they mean the value of the pointer itself, then it is true. If they mean the integer to which the pointer points, then it would be true only if memory were allocated to the destination … | |
Re: My guess is that's it's just a [cloud system](http://en.wikipedia.org/wiki/Cloud_computing) The originator of dropbox has a server computer that stores the data and a program (dropbox) on each computer that can upload/download data to/from the server. How to write such a program in c/c++? The server side is probably running PHP. … | |
Re: Post some lines from the text file. > infile.ignore(100,'#'); Why the above lines? | |
Re: I get the same error A PHP Error was encountered Severity: Notice Message: Undefined variable: page_nav Filename: views/community_view.php Line Number: 26 | |
Re: The error is much more serious than just clearning the input buffer. The loop that starts on lines 21 and 41 overflow the buffer by about 20 bytes. > fgets(&suit[i],3,stdin); The buffer suit only contains 2 bytes of memory, but the i counter counts from 0 to 20. What is … | |
Re: What driver are you trying to install? The error message has converted long filenames to standard MS-DOS 8.2 format, which is try it substituted FUNKMA-1 for Funkmaster. The only time I've seen that happen is with old MS-DOS or Win95 programs/drivers. My guess is that the driver is not compatible … | |
Re: How much do you already know how to do? Do you know how to open a file and read it one word at a time? (A word is all the characters between spaces). Have you tried to code that program yet? If not, you should. | |
Re: Your program works, just doesn't work correctly. The sort is wrong, you need to add the third parameter to std::sort and write a comparison function that returns bool value. The default third parameter is useful for only POD (plain old data) types and std::string. bool compare(RAngle& a, RAngle& b) { … | |
Re: You will have to do it in a loop and parse all the characters in the textbox. I assume from your description that the textbox holds all 5 numbers at the same time. If you don't know how to do that then maybe you should take some time to study … | |
Re: My guess is that you failed to include <string> header file and/or code the using std::string statment. | |
Re: I'm Christian, but I don't believe in the literal interpretation of the Bible. Instead I believe that the Bible was written in terms that the people at the time of its writing could understand and their understanding of the world around them. Since they had no knowledge of the Americas … | |
Re: What compiler do you want to use? If you are writing pure win32 api program then yes, you have to clean up after yourself otherwise it can cause memory leaks even after your program has closed. If that really concerns you then it might be better if you used something … | |
Re: the easiest way is to use sprintf with "%X" format specifier [code] int main() { char buf[255] = {0}; int x = 1234; sprintf(buf,"%X", x); printf("%s\n", buf); return 0; } [/code] | |
Re: line 3 is wrong because std::wstring is declared in <string> header file If you want your own class then put it in a different namespace. | |
Re: Your compiler should have produced errors on line 4 because '50' is an invalid character. Line 5 is ok becuse it does not contain single quotes like like 4. | |
Re: It usually takes a long long time for my temper to come to a boil -- for example I can work for weeks on a computer programming problem. For others, it doesn't take so long, I once trashed a compter because it wouldn't go back together the way I took … | |
Re: [Here](http://www.daniweb.com/software-development/cpp/code/216812/searching-linux-directories) is a code snippet I wrote some time ago, maybe it will help you with your question. As for the sub-directory question, see the example in my code snippet -- you have to test for them. The code snippet was written in c++, so just ignore the code you … | |
Re: The program is attempting to access non-existant table values. Lets assume a.length() == 10, then when i == 10 the statement table[i][0] is out-of-bounds because there is no element table[10][0]. Arrays are numbered 0 to but not including the upper-bounds of the array, in this case 0 1, 2, 3, … | |
Re: The where clause is incorrect. WHERE Member.MemberID = (@MemberID) AND Rentals.MemberID = Member.MemberID | |
Re: [Read this thread](http://www.webkit.org/building/tools.html) It says only vs 2005 is supported. | |
Re: One error is that the character arrays xp and choice are not big enough -- you need to leave room for the string's null terminator. atoi() could return wrong values when the string does not contain a null terminator byte. Since you include <string> header file you might as well … | |
Re: Why do you need a book for SqLite? Its just a standard SQL database, any SQL book will do. If you already know sql then you don't need a book at all, SqLite comes with several examples. | |
Re: That is only allocating one byte of memory! Why??? What is remainder? An array of integers? If that is true you don't need snprintf.. This will work, assuming the value of remainder[i] is < 126.because in C language char is just another int. char str = remainder[i]; cout << str; | |
Re: loop is simple to do [code] std::string maxlen; int n = 0; do { cin >> maxlen; n = atoi(maxlen.c_str()); if(n <= 0) cout << "You've entered a wrong number, please try again." << endl; } while( n <= 0); [/code] | |
Re: [URL="http://www.ibusy.com/articles/software-development/boost-html-library.html"]Here is boost-html[/URL] that might help you | |
Re: The error is in your code, not the compiler. You have written functions within a header file, then included that header file in two or more *.cpp files. You can't do that because you will get duplicate declaratkion errors just as you found out. Move those functions from header file … | |
I'm trying to write a simple Windows Forms program ( CLI/C++) . In the Form1 class I declared a private int, but the forms designer view hates it. Produces this error: >C++ CodeDOM parser error: Line: 195, Column: 15 --- Unknown type 'int'. ... The program compioles with 0 errors … | |
Re: There are several problems with that program. There may be other problems that I have not yet found. 1. addEntry() -- the first parameter needs to be passed by reference, not by value (See line below). That is because the array is reallocated at the start of the function, and … | |
Re: You can buy a simple 9 pin adapter at most electronic supply stores, such as Radio Shack, Best Buy and [Amazon](http://www.amazon.com/RS-232-9-pin-Serial-Adapter-Extension/dp/B0012ZOCI8) [Here are other suggestions](https://www.google.com/search?q=9+pin+serial+adapter&hl=en&prmd=imvns&tbm=isch&tbo=u&source=univ&sa=X&ei=FbXDT674HIX28wSDwICSCw&ved=0CNUBELAE&biw=941&bih=428) | |
Re: Why do you think there should be a separate c++ version of that function? Just call it from your c++ program. | |
[Here is a youtube video](http://www.stobernet.net/forums/entry.php?7-Hail-Storm) of the hail storm I had today. It has no audio, so don't toss out your headphones thinking they are broke :) | |
Re: I just now noticed that change -- at first I thought my eyesight was going because everything got a lot dimmer. I don't find it annoying at all, now that I know its not just my eyes. It makes the ads stand out a lot better which might increase the … | |
Re: Windows 7 itself contains a program that resizes the partition. If you can install Windows 7 then go to Control Panel --> System and Security --> Administrative Tools --> Computer Management --> Storage --> Disk Management Then right-click on the partition you want to shrink and click Shrink Volume. At … | |
Re: Is that all of the instructions you were given? I'm sort of surprised that your instructor didn't explain in greater detail what each of those methods were supposed to do. | |
Re: The reason for the problem is because both FileTitle and FilePath are allocated on the stack, which disappears just as soon as the function returns. The solution is to pass the filename and path to the function as parameters so that they don't get destroyed when openFileDialog() returns. BOOL OpenFileDialog(char*path, … | |
Re: According [this link](http://www.gnu.org/software/libc/manual/html_node/Attribute-Meanings.html) the data type of the file times in the stat structure are the same as time_t. Therefore all you have to do is call localtime() to get struct tm, for example `cout << strftime(mBuf, 18, "%I:%M:%S-%m/%d/%y", localtime(&sb.st_mtime));` | |
Re: There is no data type between them. One thing you could do is pack the integers into an unsigned char buffer then unpack them when needed. That is going to be a huge performance problem though. | |
Re: I started in 1982(?) while on active duty in the US Air Force. We had an HP computer that ran HP basic, pretty advanced for its day, more like PASCAL than QB. After retirement I bought a cheap computer from Radio Shack, a book (c language), and my career took … | |
Re: [QUOTE=NickyU;658044]no Does 1 + 1 equal 2 ? :D[/QUOTE] My HS math teacher said she could prove it doesn't (and this was in 1958), but I never understood why. Something to do with calculus. Is Mt. Everest getting taller ? | |
Re: Those are the two best compilers/IDEs for MS-Windows operating system. Exactly what are the problems you are having? > I am currently using code::blocks but i am experinsing trouble trying to link the ws2_32.lib Code::Bloocks doesn't use libraries with *.lib extension -- it uses *.a because CB is calling a … | |
Re: [QUOTE=Infarction;286285]Unfortunately, developers still do have to worry to some extent about CPU and memory usage. Thinks like memory leaks pop up, even if the code is easy to read and/or maintain. ;) (you forgot to free() what you allocated)[/QUOTE] There are still many cases where speed is more important than … | |
Re: What thread are you talking about? (post the link to it). I have never seen that problem. | |
Re: It all depends on the operating system, and sometimes on the compiler you are using. For MS-Windows use [console win32 api functions](http://msdn.microsoft.com/en-us/library/windows/desktop/ms682073(v=vs.85).aspx) Note that you can't use the old MS-DOS color codes with modern MS-Windows compilers. |
The End.