Forum: C++ Jul 22nd, 2009 |
| Replies: 10 Views: 508 If you're up to getting to grips with Qt, the QString class has a comprehensive range of extra methods that don't feature in std::string. One of these is split(). The advantage of this method is... |
Forum: C++ Jul 22nd, 2009 |
| Replies: 10 Views: 367 I should indeed! Touché! :)
In the instance under discussion here, vector <int> my_vec; would be the ticket. |
Forum: C++ Jul 22nd, 2009 |
| Replies: 10 Views: 367 I know that you're just starting out and doing these things as exercises, but if you want a simple and practical way to do this, then I'd use an STL vector instead of a C-style array. You need to... |
Forum: C++ Sep 9th, 2008 |
| Replies: 2 Views: 391 Does this also apply to lists? |
Forum: C++ Sep 9th, 2008 |
| Replies: 2 Views: 391 Hi, this might be a quick question, if anyone "just knows" the answers.
I want to know a little about the differences between lists and vectors. For example, I think that the elements of a... |
Forum: C++ Mar 17th, 2008 |
| Replies: 6 Views: 560 Hmm... I'm still not that sure what you're trying to do, but if I wanted to go through a list of all lower case alphabet possibilities for, say, a 3-letter word, then I might go for something like
... |
Forum: C++ Mar 17th, 2008 |
| Replies: 1 Views: 339 This seems like a good start to me. The bit for actually doing stuff is mostly about checking that the inputs are sensible. If you want to get input like you suggest, i.e. add 2 grey then you should... |
Forum: C++ Mar 17th, 2008 |
| Replies: 6 Views: 560 What have you attempted already?
If you haven't done anything yet, then you could start by using a strategy like reading in the file to a string and then change the element of the string that you... |
Forum: C++ Nov 26th, 2007 |
| Replies: 9 Views: 1,154 Sorry, I think I was posting that reply as you were posting yours. Glad you fixed your code :-) |
Forum: C++ Nov 26th, 2007 |
| Replies: 9 Views: 1,154 on line 1 you have
char* temp=""; //Temp value to hold strings
but, I think that you should assign this pointer to some memory before you use it, i.e. something like
char *temp = new char;... |
Forum: C++ Nov 20th, 2007 |
| Replies: 3 Views: 2,370 I think I'm going to use Magic++ instead, it has a much more C++-centric API! |
Forum: C++ Nov 20th, 2007 |
| Replies: 10 Views: 17,246 for(int x=2; x < width-1; x++)
for(int y=2; y < height-1; y++) {
sx = convolve_gauss(imgGrey, x, y, mask);
sy = convolve_gauss(imgGrey, x, y, mask);
imgGrey[x][y] = (sx+sy)/2;
... |
Forum: C++ Nov 19th, 2007 |
| Replies: 9 Views: 980 This isn't a syntax error, the code compiles fine. It also runs, but does not have the desired operation since a statement like 'b' always returns true, hence the error. As you said, it should be... |
Forum: C++ Nov 19th, 2007 |
| Replies: 3 Views: 541 Yep, the error is caused by the way that you have tried (admirably, but ultimately incorrectly) to catch people trying to use both upper and lower case. The solution given by Lerner should have... |
Forum: C++ Nov 19th, 2007 |
| Replies: 3 Views: 2,370 Yep, I'll try this. I couldn't find any suitable images, but I guess I'll just create one with Gimp or something,
Sorry, this is just me using the wrong word. You are, of course, correct. ... |
Forum: C++ Nov 18th, 2007 |
| Replies: 10 Views: 17,246 I don't know about your floating point error, but you are wasting a bit of time here. Because of the way this equation for generating the gaussian mask works, the maximum will always be at i = 2, j... |
Forum: C++ Nov 18th, 2007 |
| Replies: 2 Views: 642 There are a couple of good books that I used. "C++ how to program" by Deitel & Deitel is a good one that I used when I started out. It has lots and lots of code examples in it an should take... |
Forum: C++ Nov 18th, 2007 |
| Replies: 3 Views: 2,370 Hi,
Does anyone here have any experience of using libtiff in c++? I have been trying to do some simple image processing using it and I don't seem to be able to write images. I can make files... |
Forum: C++ Nov 18th, 2007 |
| Replies: 3 Views: 582 As stated by Ancient Dragon, the errors here are pretty well explained by the compiler. However, you appear to be learning from somewhere that uses some old syntax that's not best practice to use... |
Forum: C++ Nov 18th, 2007 |
| Replies: 9 Views: 980 |