Forum: C++ 4 Days Ago |
| Replies: 2 Views: 154 Looks good.
Have you considered negative bases, for fullness? |
Forum: C 4 Days Ago |
| Replies: 3 Views: 176 Does the second program have to do the same thing as the first but must be written differently?
You could always do a switch on readValue instead of the if tree. |
Forum: C++ 6 Days Ago |
| Replies: 3 Views: 174 You're passing in a const map, so you've gotta use a const_iterator:
map<string,unsigned>::const_iterator pos;
should work.
To explain. A const_iterator doesn't allow you modify anything in the... |
Forum: C++ 6 Days Ago |
| Replies: 8 Views: 175 And what errors are you getting? |
Forum: C 6 Days Ago |
| Replies: 3 Views: 126 I just code-tagged your code. Please try to do it in future.
Lemms see now... |
Forum: C++ 6 Days Ago |
| Replies: 6 Views: 169 Well... were you to decompile to hex and then recompile from modified hex you might be able to squander something... don't know if it'd work, though. Especially if the program depends on libraries... |
Forum: C++ 6 Days Ago |
| Replies: 6 Views: 169 Well... were you to decompile to hex and then recompile from modified hex you might be able to squander something... don't know if it'd work, though. Especially if the program depends on libraries... |
Forum: C++ 6 Days Ago |
| Replies: 3 Views: 174 I assume it's talking about the assignment of pos=wordlist.begin(). If so you'd imagine that wordlist isn't of type map<string,unsigned> from what the error says.
Can you post more code so we can... |
Forum: C++ 6 Days Ago |
| Replies: 1 Views: 84 Hmm. Can you show us your file?
Don't forget to delete []floatArray; |
Forum: C++ 6 Days Ago |
| Replies: 10 Views: 285 |
Forum: C 6 Days Ago |
| Replies: 1 Views: 95 Colour text: http://faq.cprogramming.com/cgi-bin/smartfaq.cgi?answer=1048382857&id=1043284392
Picture (though this mightn't work):... |
Forum: C 6 Days Ago |
| Replies: 6 Views: 219 I'm no assembly guru, but you might be able to find something were you to decompile it. |
Forum: C 6 Days Ago |
| Replies: 3 Views: 126 Show us some code I suppose.
You should know how deep each element is, and you can use the debth to see how many spaces are needed
I think it'd make sense to print the data to a string, I'd say. |
Forum: C 9 Days Ago |
| Replies: 2 Views: 148 |
Forum: C 19 Days Ago |
| Replies: 4 Views: 223 Most things can be divided. Do you mean is divided with no remainder?
The modulus operator is your friend here.
for ( i=0; i<10; i++ ) {
printf( "%d mod 4 = ", i, i%4 );
}It returns 0 if no... |
Forum: C++ 19 Days Ago |
| Replies: 3 Views: 282 All that changes with iterators that aren't 'int's is the template argument. http://www.cplusplus.com/reference/stl/vector/erase/
std::vector<randomType> myVec;
// Fill the vector with something... |
Forum: C 19 Days Ago |
| Replies: 6 Views: 276 I doubt you'll get any code for free here. So here's an outline of how you might go about it.
Grab the input from the user and compare strcmp() it against references, i.e. "January", etc (might... |
Forum: C++ 20 Days Ago |
| Replies: 9 Views: 223 As I said in post #4 :rolleyes: |
Forum: C 20 Days Ago |
| Replies: 10 Views: 352 Does that work?
I think the limits of the loops need work, and that you need to consider the input=1 case, but it looks fine. ANd yer missing a ; in places. And you don't need the else. And you... |
Forum: C 20 Days Ago |
| Replies: 10 Views: 352 Sorta. But you don't want to nest the loops. printf() after each for loop.
for ( counting up )
printf();
for ( counting down )
printf()
The second loop will be going from the upper limit to... |
Forum: C++ 20 Days Ago |
| Replies: 9 Views: 223 Try it with VS '08 so. Same code. Though get rid of the .h from the include files. |
Forum: C 20 Days Ago |
| Replies: 10 Views: 352 Ok. Consider using two for loops. One to count up to a number and one to count down. Print the looping variable. |
Forum: C 20 Days Ago |
| Replies: 4 Views: 252 That's curious.
Try doing \r\n instead. Not sure if that'll help, to be honest, but worth a try.
Can you get a hex editor and look at the hex of the file and see if the \n character is there? It... |
Forum: C 20 Days Ago |
| Replies: 10 Views: 352 Well, what to you have so far? Code wise? |
Forum: C++ 21 Days Ago |
| Replies: 9 Views: 223 You're probably using an old compiler. Might do good to update it.
Try putting a cin.get() and cin.ignore() before the return 0 in main(). Does the console window disappear, or does nothing turn up? |
Forum: C 21 Days Ago |
| Replies: 1 Views: 203 http://www.eternallyconfuzzled.com/arts/jsw_art_rand.aspx |
Forum: C 21 Days Ago |
| Replies: 10 Views: 352 |
Forum: C++ 21 Days Ago |
| Replies: 9 Views: 223 |
Forum: C++ Aug 13th, 2009 |
| Replies: 2 Views: 188 >> My question is how can I use a member function of C at D and at D's child classes?
I don't understand that sentence. Can you elaborate or show what you mean with a simple example that shows what... |
Forum: C Aug 12th, 2009 |
| Replies: 9 Views: 323 What do you need help with? Specifically? |
Forum: C++ Aug 12th, 2009 |
| Replies: 3 Views: 276 Someone asked something similar before in another forum (http://cboard.cprogramming.com/cplusplus-programming/107469-custom-loose-coupling-string.html) and you could do something like this.class... |
Forum: C++ Aug 10th, 2009 |
| Replies: 2 Views: 351 You could have it so the constructor requires a flag to ID the allocated item... so something like...class base {
public:
enum derrivableIDs {
idBase,
idOne,
idTwo
};
... |
Forum: C++ Aug 9th, 2009 |
| Replies: 3 Views: 213 Hmm. Hard to say without seeing code, really. You could always using namespace namespaceOne::namespaceTwo; if you wanted to hide the thing. |
Forum: C++ Aug 8th, 2009 |
| Replies: 6 Views: 315 Curious. You should use std::strings really...std::string strItoA(int number) {
std::ostringstream sin;
sin << number;
return sin.str();
}Though Narue may tell you to generalise... |
Forum: C++ Aug 8th, 2009 |
| Replies: 3 Views: 159 Consider what happens if all the numbers in the array are negative. Then the if(a[i]>max) will never return true. There are two ways you can do this. Either set max to INT_MIN or set max to a[0] and... |
Forum: C++ Aug 8th, 2009 |
| Replies: 4 Views: 277 I said take it out of the loop. In your code it's in the loop in the function random and it's in the loop in main. It shouldn't be in either. Take it out from both of those and seed rand once in... |
Forum: C++ Aug 8th, 2009 |
| Replies: 4 Views: 277 Check your last thread!
http://www.daniweb.com/forums/post936815.html#post936815 |
Forum: C++ Aug 6th, 2009 |
| Replies: 4 Views: 229 I go for a grazing cammel
double playerLifeForce; |
Forum: C++ Aug 6th, 2009 |
| Replies: 2 Views: 163 http://www.sqlite.org/ Never used it, but have heard people speak good about it. |
Forum: C++ Aug 6th, 2009 |
| Replies: 4 Views: 229 No.
Everyone thinks the one they use is the best. Do something that makes sense. Nobody will complain too much so long as it's sensible. |