5,331 Posted Topics
Re: [QUOTE=1ML;1494078]Hi, I've started developing for Androind [ditched Symbian but that's a whole diferent styory], and I'm not what you'd call a naturall Java developer [much prefer c++]. Eclipse seems to run rediculously slowly on windows 7 (64bit), and running a dual boot system with Linux [on which it seems to … | |
Re: All that macros do is basically text substitution, so this: [code] #define SEVEN 2 + 5 int result = SEVEN * 5; [/code] is really the same as this: [code] #define SEVEN 2 + 5 int result = 2 + 5 * 5; [/code] Applying the order of precedence for … | |
Re: In Linux/Unix systems, a dll is called a shared library, and has a .so extension. Read the g++ and linker documentation (man pages) how to do this. It is quite simple to create a shared library with Linux. In any case, the compiler directive when creating the library is -shared. … | |
Re: This isn't a C++ question. It is a question about a specific library/API for video capture. Look at the error. It indicates that it cannot connect. With what? The camera? The video stream? Don't assume people here are experts in a specific API. Questions should be restrained to C++ programming … | |
Re: [QUOTE=Momerath;1510317]You use a lot of buzzwords without defining them. Why should I care about OP?[/QUOTE] Really. It sounds like a sales pitch for snake oil... :-) The words all make sense, by themselves, but are meaningless I think when strung together like the poster did. So, advice to the poster … | |
Re: Look at the functional blocks first, those are candidates for refactoring into separate functions. For example, the sort block: [code] // sorting for (int c=0; c<size-1; c++) { for (int d=0; d<size-1-c; d++) { if (n[d] > n[d+1]) { // swapping double temp; temp = n[d]; n[d] = n[d+1]; n[d+1] … | |
Re: Your symptoms are those of an array index overrun. Ie, when you loop over an array, you are going past the end of the array. You must make sure that you are respecting the size of the array, and the number of actually set elements in it. Review all instances … | |
Re: The IEEE has a certificate in software development, the CSDP (Computer Software Development Professional) certificate. It is a fairly new program, about 3 years on now. Since it is provided and administered by the most respected EE organization in the world, the IEEE, it should be acceptable by any reasonable … | |
Re: Well, you show your code (please indent - it will be easier to analyze), but don't say anything about what is your problem. | |
Re: This is just such an egregious invasion of privacy that I am (almost) speechless... It should be as illegal and unconstitutional as it is unpalatable. | |
Re: I assume you have a personal computer and/or laptop? Probably running some variety of Windows? Ok. Take that (or one of them, scrub Windows off, and get Linux From Scratch (LFS). It is a book and boot CD that will walk you through the entire process of building a Linux … | |
Re: Wouldn't you think it's time for a trip to the local college library? Or a least some serious googling... In any case, it should be "object based data model". Using that for google search terms, a lot of useful stuff, including scholarly articles, result that directly address your question. | |
Re: Show us what you are doing now. | |
Re: These sort of tests take so little time (nanoseconds) that the clock() function cannot resolve them. Usually what we do is to time a loop calling the function in question for many thousands of iterations. Then we can get a rational timing number which we can then divide by the … | |
Re: And do you want coffee with that meal? Sorry, but read the terms of service for this forum. We'll help you with homework if you make a good-faith effort to solve the problem yourself, but we will not do your work for you... :-( | |
Re: Here is a link to a java implementation of trapezoidal integration methods. It should not be difficult to port to C++ or C: [url]http://911programming.wordpress.com/2010/07/12/java-integration-using-composite-trapezoidal-rule/[/url] Sorry, but I haven't found anything in C or C++ yet. | |
Re: These sort of problems are much more amenable to understanding if you first write out your algorithm either mathematically, or in many cases, in plain language pseudo-code. Example for an insertion sort (your final code is not using an insertion sort, because it is sorting after the array is generated), … | |
Re: You have made a start on defining the problem. Work it out in pseudo-code (describe in plain language the data and processes you need to transform that data to get the results you need), and analyze that until you are clear on what you want to do. At that point, … | |
Re: Get Bruce Schneier's seminal book "Applied Cryptography". It will help you get a much better understanding what cryptography is and what cryptographic algorithms are. | |
Re: Actually, it more properly called the Stable Marriage Problem. Here is an article that may help: [url]http://en.wikipedia.org/wiki/Stable_marriage_problem[/url] | |
Re: [QUOTE=ranjani jai;1479727]I need an idea to find the completeness and hardness of my program.. how to begin with this work...any idea or links to learn more?..[/QUOTE] First, learn what [B][I]precisely[/I][/B] np-hard and np-complete mean in mathematical terms. From your post I doubt you have any clue... | |
Re: I found this book to be really good for the theory of parsing techniques. I've had it for about 20 years, but it looks like there is a new edition out: [url]http://www.amazon.com/Parsing-Techniques-Practical-Monographs-Computer/dp/1441919015[/url] Of course is was a LOT cheaper then - I paid $39 USD for it in 1990-91. | |
Re: This is one of those things that the standards allow implementations to "do their own thing" on. A string literal may (or may not) be in read-only memory as a constant. So, gerard4143 is absolutely correct if you want to modify the contents of the string in a platform-neutral manner. … | |
Re: Think out the algorithm first. You want to remove the lowest and highest values, so first read all values into an array, determining the high/low values as you go and adding up the number of items read. When you are done, iterate through the array, adding up all but the … | |
Re: Line 54: string used = ""; string used is also a function argument. This is a conflict because you are also declaring a local variable string named "used". | |
Re: When you post C++ code like this, also post the class header. Without it, we are flying blind, so to speak. Also, explain what your Heap class is supposed to be doing - what it's purpose is, as clearly as possible. If we know your intention, we can better advise … | |
Re: There are a number of differences between static and dynamic (shared) libraries. I'll summarize some of the more important ones: 1. If you alter a static library and wish for your applications that use it to get the new code, you have to relink them. With shared libraries, you just … | |
Re: WordCount algorithm: [code] for current character = beginning-of-text to end-of-text while current character is white-space go to next character end while if current character is not end-of-text increment word count while current character is not white-space and not end-of-text go to next character end while end if end for [/code] … | |
Re: What do you mean? The term "flag" can have many meanings, so your question is just too general to answer without writing a thesis on the term... :-( | |
![]() | Re: Most GUI libraries these days are C++, but as gerard4143 said, you can use GTK or GTK+ which has C language bindings. Any reason not to use C++ in favor of C? With C++ you have Qt, wx, and others that are widely used and very powerful. |
Re: This is NOT simple stuff! First, C++ is NOT a scripting language. It is a fairly low-level system programming language with a lot of nuances - the devil being in the details. Second, audio programming like what you say you want to do, is not a simple proposition. My advice? … | |
Re: One of the primary purposes of homework assignments is to get the student to think for themselves, and develop problem-solving skills. When you get into the workplace, you won't have the luxury of asking others to do your work for you... Ok, I lied. There are plenty of manipulative people … | |
Re: Absolutely. If you are going to use it anywhere at all, even in other parts of your code, you need to do that, otherwise it will just get repeated (probably incorrectly) all over the place. A header file is saying "These are the interfaces to useful stuff. If you use … | |
Re: Please provide full definition (.h file) for the BinaryTree<T> class. | |
Re: Have you made the operator >> a friend of the Matrix class? If you don't, it can't get access to the internal parts of Matrix, assuming they are (properly) private or protected. Also, have you determined that the format of the input data is compatible/parseable with the method by which … | |
Re: Please don't ask us to solve your homework problems. :-( We will help you find a path that will work for you, but you need to try to solve the problem first, and then ask for comments or corrections. | |
Re: Well, that should work. I think your comment about sortScores() being hinky (the correct technical term) is probably correct. However, it would be better just to treat scores as an array. Ie, [code] double avg(double *scores, int numScores) { double total = 0.0; double average; sortScores(scores, numScores); for(int count = … | |
Re: What system and compiler are you using? On Linux/Unix, there is a man page that gives details. Also, are you using pthreads (POSIX threads), or other threading API's? | |
Re: What platform (OS + version) and compiler (type and version) are you using? | |
Re: I don't know if this is available on Windows, but on Linux/Unix/Posix systems there is are two functions statvfs() and fstatvfs() that fill a structure that includes the size of blocks on the device and the number of free blocks. All you need to do to find available space is … | |
![]() | Re: What is it that you are trying to do? The question has a number of answers, dependent upon your goals. 1. If you want to take C++ code, compile it, and access/run it inside an already running code that is one thing. 2. If you want to take C++ code, … ![]() |
Re: Try something you'd personally find useful, such as a CD/DVD cataloging application. Since you want to program in C++ (my favorite language - been using it for 20 years), try to "think objectively". Think about the things you are modeling, and write the classes for those things with the behavior … | |
Re: Please clarify what you mean. Are you talking about numeric data of 2^64, or data set sizes up to 2^64 bytes? If the first, you either need to use 64-bit data types (assuming these are unsigned integer values), which in modern C/C++ is an "unsigned long long" data type; however, … | |
Re: Well, C and C++ are infix expression languages, so you need to read the postfix input, convert it to an evaluation tree, and then process the tree. I've done this before (about 25 years ago), but it isn't particularly simple. A good text on the subject is Donald Knuth's seminal … | |
Re: A learning disability does not mean unintelligent. The question isn't "shifty", and I can understand your frustration. Unfortunately, there is no simple answer. I personally don't use Windows drawing API's because most of the work I do has to run on many different operating systems (Unix, Linux, QNX, Windows, mobile … | |
Re: Also note the constructor for the Person class, that the member variables are initialized inside the body of the constructor. This is very much beginner practice/mistake, and "not good", the reasons for which I shall not get into here (long-winded lecture material). However, each constructor has an initialization block between … | |
Re: This is just another name for substring search. Again what I keep saying to you programming newbies - understand clearly first what your task is and then write out what you need to do in plain language pseudo-code each step that you need to take to accomplish your task. Design … | |
Re: Better: [code] struct Segment { int start, end, value; }; class Set { private: vector<Segment*> segments; public: Set() {} virtual ~Set() { for (size_t i = 0; i < segments.size(); ++i) { delete segments.at(i); } } vector<Segment*>& getSegments() { return segments; } const vector<Segment*>& getSegments() const { return segments; } … | |
Re: griswolf is heading in the right direction. Use an XML structure for your collection, which is basically what a singly linked list is, an ordered collection of similar things/objects. That's very easy in XML form: [code] <list> <element> <field1>1</field1> <field2>my name</field2> </element> <element> <field1>2</field1> <field2>your name</field2> </element> . . . … | |
Re: To clear a terminal or console on any Unix/Linux system or other system with an ANSI, xterm, or DEC VT-100-compatible terminal, you can output a ^L (control-L) hex 0x0C (form-feed character) to stdout and that should do it. BTW, the system command to clear the screen on Linux systems is … |
The End.