Search Results

Showing results 1 to 40 of 1000
Search took 0.10 seconds.
Search: Posts Made By: twomers
Forum: C++ 7 Days Ago
Replies: 2
Views: 186
Posted By twomers
Looks good.
Have you considered negative bases, for fullness?
Forum: C 7 Days Ago
Replies: 3
Views: 231
Posted By twomers
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++ 9 Days Ago
Replies: 3
Views: 201
Posted By twomers
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++ 10 Days Ago
Replies: 8
Views: 192
Posted By twomers
And what errors are you getting?
Forum: C 10 Days Ago
Replies: 3
Views: 145
Posted By twomers
I just code-tagged your code. Please try to do it in future.
Lemms see now...
Forum: C++ 10 Days Ago
Replies: 6
Views: 193
Posted By twomers
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++ 10 Days Ago
Replies: 6
Views: 193
Posted By twomers
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++ 10 Days Ago
Replies: 3
Views: 201
Posted By twomers
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++ 10 Days Ago
Replies: 1
Views: 92
Posted By twomers
Hmm. Can you show us your file?
Don't forget to delete []floatArray;
Forum: C++ 10 Days Ago
Replies: 10
Code Snippet: Text - Based RPG V2
Views: 352
Posted By twomers
Not exactly a snippet ;)
Forum: C 10 Days Ago
Replies: 1
Views: 108
Posted By twomers
Colour text: http://faq.cprogramming.com/cgi-bin/smartfaq.cgi?answer=1048382857&id=1043284392
Picture (though this mightn't work):...
Forum: C 10 Days Ago
Replies: 6
Views: 241
Posted By twomers
I'm no assembly guru, but you might be able to find something were you to decompile it.
Forum: C 10 Days Ago
Replies: 3
Views: 145
Posted By twomers
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 12 Days Ago
Replies: 2
Views: 163
Posted By twomers
It works for me...
Forum: C 22 Days Ago
Replies: 4
Views: 227
Posted By twomers
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++ 22 Days Ago
Replies: 3
Views: 313
Posted By twomers
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 22 Days Ago
Replies: 6
Views: 284
Posted By twomers
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++ 24 Days Ago
Replies: 9
Views: 231
Posted By twomers
As I said in post #4 :rolleyes:
Forum: C 24 Days Ago
Replies: 10
Views: 371
Posted By twomers
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 24 Days Ago
Replies: 10
Views: 371
Posted By twomers
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++ 24 Days Ago
Replies: 9
Views: 231
Posted By twomers
Try it with VS '08 so. Same code. Though get rid of the .h from the include files.
Forum: C 24 Days Ago
Replies: 10
Views: 371
Posted By twomers
Ok. Consider using two for loops. One to count up to a number and one to count down. Print the looping variable.
Forum: C 24 Days Ago
Replies: 4
Views: 262
Posted By twomers
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 24 Days Ago
Replies: 10
Views: 371
Posted By twomers
Well, what to you have so far? Code wise?
Forum: C++ 24 Days Ago
Replies: 9
Views: 231
Posted By twomers
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 24 Days Ago
Replies: 1
Views: 205
Posted By twomers
http://www.eternallyconfuzzled.com/arts/jsw_art_rand.aspx
Forum: C 24 Days Ago
Replies: 10
Views: 371
Posted By twomers
ANd the problem is?
Forum: C++ 24 Days Ago
Replies: 9
Views: 231
Posted By twomers
Code?
Forum: C++ Aug 13th, 2009
Replies: 2
Views: 188
Posted By twomers
>> 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
Posted By twomers
What do you need help with? Specifically?
Forum: C++ Aug 12th, 2009
Replies: 3
Views: 283
Posted By twomers
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: 360
Posted By twomers
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: 214
Posted By twomers
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: 317
Posted By twomers
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: 163
Posted By twomers
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: 278
Posted By twomers
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: 278
Posted By twomers
Check your last thread!
http://www.daniweb.com/forums/post936815.html#post936815
Forum: C++ Aug 6th, 2009
Replies: 4
Views: 232
Posted By twomers
I go for a grazing cammel
double playerLifeForce;
Forum: C++ Aug 6th, 2009
Replies: 2
Views: 163
Posted By twomers
http://www.sqlite.org/ Never used it, but have heard people speak good about it.
Forum: C++ Aug 6th, 2009
Replies: 4
Views: 232
Posted By twomers
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.
Showing results 1 to 40 of 1000

 


About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC