15,300 Posted Topics
Re: Post the relevent code here that you have a question about. Most people won't download and unzip that file on their computers. | |
Re: You might try one of [URL="http://www.google.com/#hl=en&source=hp&q=c+program+equation+solver&aq=f&aqi=&aql=&oq=&gs_rfai=CJoGXjBZ1TPOOM47EM_jV_PQPAAAAqgQFT9BB0Q4&pbx=1&fp=ad526d12389e3c08"]these[/URL] | |
Re: I have a custom user title too, because it's true that after 25+ years I'm still learning :) And I didn't like the default title -- too boastful. | |
Re: If you are going to buy a new hard drive get the biggest one you can affort because in a couple years it won't be big enough! A few years ago the first hd I bought was 80 meg and cost about $500.00 USD. I thought it would last forever, … | |
Re: [URL="http://lmgtfy.com/?q=tasm+tutorial"]task tutorial[/URL] | |
Re: So what's your question? We are not going to write your program for you. Compression algorithms are much more complex than what you posted. For example you can get [URL="http://www.zlib.net/"]free Zlib source code here[/URL] | |
Re: globals are initialized to 0. Locals are left uninitialized, so they just contain whatever random value was at that memory location when the variable is created. If you see a local that has the value of 0 then that means either you explicitly initialized it to 0 or the value … | |
Re: I assume you mean the console screen. First you have to figure out the screen width in characters. The old MS-DOS window was 80 characters wide, but that is no longer true. Once you know the screen width then the rest should be easy math. Something like this: [code] int … | |
Re: >>scanf("%s", & current_ptr -> name); scanf() will not allow you to enter a name with spaces. If you want the spaces, such as first <space> last name then use fgets() [icode]fgets(current_ptr->name, sizeof(current_ptr->name), stdin);[/icode] One problem wth fgets() is that it will add the '\n' enter key to the end of … | |
Re: Look at the file cstring and you will find out for yourself what the difference between it and string.h is. My compiler just includes string.h in cstring an them does the using statements for each of the functions Honestly now -- how difficult is it for you to look at … | |
Re: What compiler are you using? Looks like os is MS-Windows but using *nix opendir() and associated functions. In any event, you don't need to use chdir(). Just call list() recursively for each subdirectory that's encountered. | |
Re: >> submitted 400 jobs to cluster What does that mean? | |
Re: Wow! talking about resurrecting an old thread. This one is 8 years old. :icon_eek: | |
Re: google for "network sniffers" and you might find some source code, but don't count on it. | |
Re: >>my compiler (bloodshed's dev-c++ v4.9.9.2) Upgrade to Code::Blocks and MinGW compiler because its more current then the version you are using >>int printBoard(const int[][]); //prototype Change that to remove the [b]const[/b] attribute. With 2d arrays the second array can not be left without a size. [icode]int printBoard(int[][size]); //prototype[/icode] | |
Re: No, but I have a notebook. Will that be sufficient for whatever you want it for? | |
Re: The compiler is not the problem -- the problem is that no 32-bit operating system will support such a huge array. Even a 64-bit os and 64-bit compiler will have problems with it. You will just have to redesign your program so that it doesn't need tnat array. For example, … | |
Re: Is that trying to compare the first two characters of each std::string? [icode]if( number.substr(0,2) == myvector[x].substr(0,2))[/icode] | |
Re: Write your own pair class and implement the == operator any way you want. | |
Re: [URL="http://www.boost.org/doc/libs/1_44_0/doc/html/boost_random.html"]Check out this Boost library.[/URL] | |
Re: >>myValue= new char[sizeof(textVal)]; That won't work because sizeof(testVal) is nothing more than sizeof(char *), or 4 on most 32-bit compilers. What you want is [icode]myValue= new char[strlen(textVal)+1][/icode] then on the next line call strcpy() instead of memcpy(). Those two lines can be combined like this: [icode]myValue = strdup(element->GetText());[/icode]. To destroy … | |
Re: The problem is lines 4 and 5 are incorrect. Remove the = in those two lines. | |
Re: And have a hand extend out of the monitor and slap him silly. I've seen an avatar something like that but don't remember whose it was. | |
Re: Yes I agree. His prof didn't forbid him from getting help on the net, just for copying someone else's work and calling it his own. | |
Re: line 19: What exactly do you expect sizeof() to return on that line? Answer: sizeof() is returning the size of a pointer, not the length of the string to which it points. In otherwises use of the sizeof operator on that line is meaningless. | |
Re: 1. use a loop 2. call [icode]srand( (unsigned int)time(0));[/icode] to initialize the random number generator, then for each number call [icode]rand()[/icode] to get a random number. 3. google for sort algorithms. The bubble sort is the easiest to code but the slowest. In c++ you can also use the std::sort() … | |
Re: Put the questions is an array of strings then you can use rand() as an index into that array. Something like this [code] char *questions[] = {"one","two","three","four","five"}; srand((unsigned int)time(0)); do { int index = rand() % 5; // cout << questions[index]; } while(true); [/code] | |
Re: what do you mean it doesn't work?? I use [icode]system("cls");[/icode] occasionally and never had a problem. | |
Re: If you don't use code tags then nobody will look at your program. Also you need to tell us what problem(s) you are having with it, what compiler and operating system you are using. Afterall, we are not mind readers. | |
Re: >>please can any one write the code without using pointers I don't think that's possible. | |
Re: You have 500,000 mentors right here at DaniWeb. Just ask and someone will be glad to help with whatever problems you have. And BTW software development is still alive and well here in USA and most likely in Europe too. | |
Re: NODE_WATER_ATTR_ENABLE is a function and Attrribute() wants a char*. Try this: [icode]element->Attribute (XMLNodeNames::NODES::NODE_WATER_ATTR_ENABLE());[/icode] | |
Re: main() has to return an integer, not anything else such as char*. Replace that return statement with something like this: [icode]return 0;[/icode] | |
Re: >>One other factor which complicates my situation is that I have a felony As an adult or a juvenile? And how recent? Your chances of getting a US Government related job (or a job with a contractor who has government contracts) is slim to none. Sounds like you want to … | |
Re: >>if(a==1|2|3|4|5|6|7|8|9|0<b&c&d&e&f&g) comparisons don't work like that in C or C++ languages. First off, variable [b]a[/b] is only one digit, so why are you bothering to check that it is a number between 0 and 9? There are no other possibilities. Put all the numbers in an array so that they … | |
Re: You have to do it with a gui program -- can't be done with console. [URL="http://winprog.org/tutorial/"]Here [/URL]is a tutorial about how to get started writing MS_Windows gui programs. After you learn the basic then you need to learn all about fonts and how to manipulate GDI objects. I know you … | |
Re: Never try to crete a file in the root folder of C: because you may not have persmissions to do that. Move it to a different folder that. void main() -- main() always returns an integer, never void. Some compilers may permit void but that is non standard and will … | |
Re: What flavor of assembly? Not all assembly languages are equal. For 80x88 assembly, look at the functions in int 21h. | |
Re: You have to use win32 api [URL="http://msdn.microsoft.com/en-us/library/ms682073.aspx"]console functions.[/URL]. And check out the [URL="http://www.codexxi.com/MyBlocks.html"]console object here[/URL] for example code | |
Re: [URL="http://www.programmingforums.org/thread23471.html"]Another example program I wrote is here[/URL] | |
Re: Its all in the file extension -- *.cpp is c++ and *.c is C. After you create a c++ console project just rname the *.cpp file to *.c. Or you could create an empty console project and add *.c files to it. | |
Re: [URL="http://www.daniweb.com/forums/thread306049.html"]Now really -- you two guys need to talke to each other.[/URL] | |
Re: Lots of people all over the world write c/c++ programs in languages other than English. However, the c/c++ keywords are all in English. I haven't seen another compiler that use non-English keywords, but that doesn't mean there aren't any. | |
Re: My version of Windows 7 does not have a bind.exe, and it isn't in the Windows SDK/bin directory either. According to [URL="http://www.threatexpert.com/files/bind.exe.html"]this[/URL] bind.exe may be a virus. | |
Re: >>int &array That does not create an array. All it is is a reference to an integer. If you want an array that you have one of two choices [icode]void foo(int array[])[/icode] or [icode]void foo(int *array) [/icode] or just return the array [code] int* foo() { int *ay = new … | |
Re: First you will have to move the declaration of that structure that's in addrecords() up to the top of that *.cpp file so that it can be used everywhere in the program, not just in addrecords() Have you tried to compile all that code? I'll bet you haven't because I … | |
Re: for starters line 14 does not allocate memory for the string's null terminating character. So line 23 writes beyond the end of the character array. line 28 should be [icode]delete[] string;[/icode] line 42: pass strings class by reference [icode]int operator==(strings& obj)[/icode] | |
Re: You might try to compile that with another compiler that supports template specialization. The last I know Microsoft compilers did not support it, but that could have changed with VC++ 2008. | |
Re: First of all get a different compiler because that one is old and obsolete. Get either Code::Blocks/MinGW or VC++ 2010 Express, both are free. Now you have a choice of using pure win32 api functions for graphics, or wxWidgets c++ class library (there are probably others too.) Both have online … | |
Re: You mean [URL="http://www.w3schools.com/webservices/ws_intro.asp"]this[/URL]?? |
The End.