1,177 Posted Topics
Re: You're really going to have to narrow down the problem/make it much more explicit. Some recommended reading: [url]http://daviddoria.blogspot.com/2010/05/problem-abstraction-helping-others-help.html[/url] Dave | |
Re: You'll have to show us the printToFile function. I also recommend [code] if ( c >= 12) { x[i].printToFile(outFile1); std::cout << "File1" << std::endl; } else { x[i].printToFile(outFile2); std::cout << "File2" << std::endl; } [/code] to make sure the conditional is triggered correctly. Dave | |
Re: Do you have a matrix class? If not, I'd recommend vnl_matrix from VNL (part of VXL). You can then just do: [code] yourMatrix(r1,c1) = float1 [/code] Dave | |
Re: Here are a handful of explanations and possible solutions: [url]http://www.daniweb.com/forums/thread114299.html[/url] | |
I have some white text I am putting over a very light background. Is there anyway to outline the text in black? After some googling it looks like there are some pretty complicated solutions, but I am looking for something like a check box that says "outline". Is there such … | |
I set the .Interval of a timer to "10", which I believe means 10 milliseconds. Since there are 1000 ms in 1 second, if I count to 100, I should have 1 second, right? The problem is, if I use a physical stop watch and compare it to my program, … | |
Re: I imagine the problem is how you are actually compiling it. You need to compile both countertest.cpp as well as counter.cpp. My guess is that you are only compiling countertest.cpp. Dave | |
Re: Read in the file, then search the text in c++? | |
Re: Well the first major problem is that you are not passing the variables by reference to GetScore, so they aren't going to be available when you leave it! | |
Re: I'd suggest using a library for image processing such as VTK, OpenCV, or VIL (part of VXL). Dave | |
Re: First, please use real English words (i.e. not "dis"). Second, I would keep track of the number in a separate counter that is incremented manually in the inner loop rather than trying to increment j and m in the loop definition. Give that a try and see if it helps. … | |
Re: Here's the deal - I'll spend as much time helping you as you have spent trying yourself! Ok, I'm done! | |
Re: Since this is a non-native c++ thing, I would recommend using system() to call the appropriate system command to get the terminal size (I don't know what it is, but I'm sure one exists). Include in the command writing this result to a file. Then read the file in your … | |
Re: vtkPNGReader is able to read alpha values: [url]http://www.vtk.org/doc/nightly/html/classvtkPNGReader.html[/url] | |
Re: Please try to replicate the problem in as few lines as possible - I'm guessing you can start paring down the code and get it to < 20 lines to produce the same problem. This process will probably magically point out the problem! If it doesn't, then we'd be happy … | |
Re: Is this for a class assignment or you need it for work? | |
Re: I don't think it makes sense to use [icode]<<[/icode] on an ifstream. I think you should look into the getline() function. You shouldn't have to overload the >> operator to do this. Dave | |
Re: This might go better in the Game Development subforum: [url]http://www.daniweb.com/forums/forum71.html[/url] Dave | |
Re: I didn't look at the code - but maybe you want to make an [icode]std::vector<Player>[/icode] ? Dave | |
Re: I think this would go better in the Game Development subforum: [url]http://www.daniweb.com/forums/forum71.html[/url] Dave | |
Re: 1) please use code tags 2) is this for an assignment (i.e. are you wanting help writing the sort?)? If not, then look at the STL algorithm sorting functions: [url]http://www.cplusplus.com/reference/algorithm/[/url] [url]http://www.cplusplus.com/reference/algorithm/sort/[/url] Dave | |
Re: 1) Please make your titles informative - "Gaussian elimination" is much more informative than "Help. Gr11 array chap project" 2) This should get you started [url]http://en.wikipedia.org/wiki/Gaussian_elimination#Algorithm_overview[/url] Dave | |
Re: abdulsaboor30 - please use code tags and do not do peoples assignments for them! | |
Re: This may be partially my fault - I told him to start this thread because the discussion in a previous thread now had nothing to do with the title. | |
Re: Please be much more specific. You want to color words in a terminal? Or are you using a GUI? | |
Re: 'outfile' doesn't seem to be defined. This code works fine for me: [code] #include <iostream> using namespace std; int main() { string text; int nl = 0; cout<<"Press enter twice in a row to quit: "; while (nl < 2 && getline(cin, text)) { if (text.empty()) { ++nl; } cout … | |
Re: No one is going to help you unless you have tried it yourself first! | |
Re: It looks like a good way is to direct the results of the command to a file and then read the file in c++: [url]http://www.cplusplus.com/forum/general/1253/[/url] | |
Some of you may have noticed that I am always harping about "abstracting the problem" and "posting the smallest compilable piece of code that demonstrates a problem." I rambled a bit about why this is important if anyone cares to read: [url]http://daviddoria.blogspot.com/2010/05/problem-abstraction-helping-others-help.html[/url] Dave | |
Re: Try to cut out code until it is short enough to post here using code tags (< 30 lines). That will help you find the problem, as well as help us fix it if you can't. | |
Re: What language is this? Please try to abstract your problem - if you need help with a loop, then write a simple loop and show us where the problem is. "How do I give a player weapons?" is not a c++ question. "How do I loop over an array?" is … | |
When I click the "Unanswered" tab to see all of the posts that have 0 replies, I get a page of threads that indeed have 0 replies. When I click on the "2" (for page 2) or the "next" button at the bottom to go to the next page of … | |
Re: Here is how to do it with VTK: [url]http://www.vtk.org/Wiki/VTK/Examples/Images/BackgroundImage[/url] Dave | |
| |
Re: Sounds like you need to make a "Fraction" class and then make an array (I'd recommend a std::vector) of Fraction objects. [code] std::vector<Fraction> fractions; [/code] I hope this gets you started - once you get some code written post it here and I'm sure someone can help you with any … | |
Re: I always recommend trying to abstract the problem. Here, your problem has nothing to do with translation. You simply want to know "How do I display a string in a text box?", right? Unfortunately I don't do any windows gui programming, but surely someone can help if you post a … | |
Re: Please use code tags to post the smallest compilable example of the problem. Subscript out of range means you are doing something like [icode] myArray[5][/icode] when the array only has 3 elements, or something like that. Dave | |
Re: Please use code tags to post the relevant parts of the code - no one wants to look through 10 files! Dave | |
Re: I'd suggest using a library that can deal with images. For example, VIL (part of VXL) or VTK (vtk.org). Dave | |
Re: Please boil your question down to a 20 line, compilable piece of code that we can help you with. If you don't want to do your homework, why would we?? Dave | |
Re: You're going to have to show some effort before anyone is going to help you with your project. Have you written any code so far? I'm not sure how they're expecting you to know the form/shape of the letters - do you have any additional input files? (b/w images of … | |
Re: This does not look like standard/modern c++. You should [icode]#include <iostream>[/icode] instead of [icode]#include<iostream.h>[/icode] Then you should do the reading with the >> ifstream operator instead of .read and the << ofstream operator instead of .write. Dave | |
Re: You should look for the opencv forum (maybe it is a google group, I forget exactly). This is not a c++ question so you probably won't find much help here :( | |
Re: I would use VTK - it is basically a wrapper around openGL that allows you to do things much more easily. For either OpenGL or VTK, there is a pretty extreme learning curve - shouldn't you be learning something like this in your class??? | |
Re: Is this for a course or for real use? If you intend to actually use the code - I would highly recommend going with an already developed mathematical toolkit for c++, such as VNL (part of VXL). It will most definitely be very optimized an provide all of the functionalities … | |
Re: 1) Please use code tags 2) Please use a reasonable indention scheme for your braces (maybe not using code tags affected this?) 3) Try to narrow down your question to the smallest piece of code possible. Maybe make a 10 line example that fills a vector and then ask "how … | |
Re: First, please use code tags. Instead of writing a "header", I think you mean you need to write the "class" called extRoman. at the very least you have a bunch of operator overloading to do (--, ++, +, <<, *). Sounds like you'll also need some functions for averages etc. … |
The End.