5,331 Posted Topics

Member Avatar for 1ML

[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 …

Member Avatar for 1ML
0
586
Member Avatar for dospy

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 …

Member Avatar for dospy
0
171
Member Avatar for jackmaverick1

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. …

Member Avatar for jackmaverick1
0
180
Member Avatar for kiske

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 …

Member Avatar for rubberman
0
538
Member Avatar for pdooley

[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 …

Member Avatar for Momerath
-1
131
Member Avatar for lanzslumber

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] …

Member Avatar for rubberman
0
258
Member Avatar for Coffee_Table

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 …

Member Avatar for Coffee_Table
0
247
Member Avatar for Transcendent

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 …

Member Avatar for rubberman
0
326
Member Avatar for epicbeast9022

Well, you show your code (please indent - it will be easier to analyze), but don't say anything about what is your problem.

Member Avatar for rubberman
0
219
Member Avatar for slfisher

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.

Member Avatar for rubberman
0
755
Member Avatar for ITnoobMike

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 …

Member Avatar for rubberman
0
232
Member Avatar for aswad56

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.

Member Avatar for rubberman
-1
65
Member Avatar for cse.avinash
Member Avatar for Sc@recrow

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 …

Member Avatar for rubberman
0
130
Member Avatar for king.chang

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... :-(

Member Avatar for rubberman
-2
59
Member Avatar for volkang

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.

Member Avatar for volkang
0
168
Member Avatar for Sc@recrow

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), …

Member Avatar for Sc@recrow
0
663
Member Avatar for penguino138

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, …

Member Avatar for Stefano Mtangoo
0
1K
Member Avatar for dresposure

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.

Member Avatar for rubberman
0
333
Member Avatar for blueRo

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]

Member Avatar for rubberman
0
400
Member Avatar for ranjani jai

[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...

Member Avatar for rubberman
-1
88
Member Avatar for Annuate

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.

Member Avatar for rubberman
0
160
Member Avatar for harish9

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. …

Member Avatar for rubberman
0
146
Member Avatar for hobbyenthusiast

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 …

Member Avatar for WaltP
0
269
Member Avatar for Khoanyneosr

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".

Member Avatar for Khoanyneosr
0
279
Member Avatar for CSWalls

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 …

Member Avatar for CSWalls
0
252
Member Avatar for b56r1

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 …

Member Avatar for rubberman
0
134
Member Avatar for moorekwl92

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] …

Member Avatar for rubberman
0
172
Member Avatar for android_sylph

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... :-(

Member Avatar for Fbody
0
103
Member Avatar for hohoho89

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.

Member Avatar for rubberman
0
176
Member Avatar for JB Audio

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? …

Member Avatar for rubberman
0
641
Member Avatar for jambul_16

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 …

Member Avatar for rubberman
-1
107
Member Avatar for maybnxtseasn

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 …

Member Avatar for rubberman
0
58
Member Avatar for sdr001

Please provide full definition (.h file) for the BinaryTree<T> class.

Member Avatar for rubberman
0
99
Member Avatar for winecoding

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 …

Member Avatar for rubberman
0
229
Member Avatar for amari ♥

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.

Member Avatar for rubberman
0
128
Member Avatar for scarlettmoon

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 = …

Member Avatar for mike_2000_17
0
381
Member Avatar for sirko

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?

Member Avatar for rubberman
0
192
Member Avatar for digitup1
Member Avatar for template<>
0
190
Member Avatar for TailsTheFox

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 …

Member Avatar for TailsTheFox
0
134
Member Avatar for anu07

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, …

Member Avatar for anu07
0
178
Member Avatar for zack654

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 …

Member Avatar for zack654
0
150
Member Avatar for cse.avinash

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, …

Member Avatar for rubberman
0
135
Member Avatar for gyuunyuu

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 …

Member Avatar for gyuunyuu
0
421
Member Avatar for spoon licker

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 …

Member Avatar for Saith
0
225
Member Avatar for SeePlusPlus2

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 …

Member Avatar for rubberman
0
128
Member Avatar for poloblue

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 …

Member Avatar for poloblue
0
159
Member Avatar for rwarlord

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; } …

Member Avatar for rwarlord
0
406
Member Avatar for sara90

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> . . . …

Member Avatar for template<>
0
121
Member Avatar for clutchkiller

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 …

Member Avatar for Narue
0
2K

The End.