User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
DaniWeb is a massive community of 402,505 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,772 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Showing results 1 to 40 of 174
Search took 0.02 seconds.
Posts Made By: bugmenot
Forum: C++ 30 Days Ago
Replies: 10
Views: 845
Posted By bugmenot
Re: Printing Debug Message in Visual Studio C++ 2005

This isn’t entirely true. While the debugger is great for most apps, there are times when it is not feasible, if not outright impossible to use the debugger.

It’s called Heisenberg debugging,...
Forum: C++ Jun 7th, 2008
Replies: 4
Views: 241
Posted By bugmenot
Re: Continue statement and alternatives

No. "continue" skips the remaining iteration of the loop (in this case, the for loop). So it goes directly to the "n++" step, and then starts the next iteration of the loop, testing the condition and...
Forum: C++ Jun 7th, 2008
Replies: 14
Views: 495
Posted By bugmenot
Re: Vector and virtual function questions

why not just call
pedal()
what is the difference?

if pedal is a virtual function in "cycle", then both will accomplish the same thing


this is identical to just
pedal()
Forum: Java Jun 7th, 2008
Replies: 1
Views: 201
Posted By bugmenot
Re: Help - Writing program to get Hundredth of a Number

you can compute it by dividing by 100 (removes the last 2 digits) and then mod'ing by 10 (only keeps the last digit)
(x / 100) % 10
Forum: C++ Jun 6th, 2008
Replies: 7
Views: 347
Posted By bugmenot
Re: Memory Allocation Understanding, new []()

No. The vector takes care of deallocating any memory it uses when it is destructed, which also destructs all the things in the vector. The string takes care of deallocating any memory it uses when it...
Forum: Java Jun 3rd, 2008
Replies: 3
Views: 191
Posted By bugmenot
Re: When would one ever use the Method class?

Reflection. you need it when you want to invoke a method by reflection. A method does not have to be public to be invoked. However, you will need to know how to get it. (Class.getMethod() will not...
Forum: C++ May 31st, 2008
Replies: 2
Views: 168
Posted By bugmenot
Re: Frustrated with Arrays of Objects

The standard way to do it with inheritance is probably to have an array of Employee pointers

Employee* employees[10];

(You can also dynamically allocate it if you really wish. It will be...
Forum: C++ May 29th, 2008
Replies: 14
Views: 442
Posted By bugmenot
Re: Problem in Inheritance

that's not what was asked
Forum: C++ May 29th, 2008
Replies: 9
Views: 600
Posted By bugmenot
Re: Private pointer variable in parent class

If there is truly a legitimate reason for a subclass to want to access a field, it should be declared "protected".
Forum: C++ May 29th, 2008
Replies: 7
Views: 432
Posted By bugmenot
Re: Confused about use * in declaring char arrays

These are identical. It is a pointer in both cases. So I guess it may be more clear to write it as a pointer. The second case might cause beginners to think that you are passing an entire array by...
Forum: Python May 28th, 2008
Replies: 3
Views: 1,023
Posted By bugmenot
Re: sqlite3-- how to see column names for table

This seemed inefficient to me, so I looked around for another way. Here is a simpler way to do it, using the sqlite3.Cursor.description attribute.

from sqlite3 import dbapi2 as...
Forum: C++ May 24th, 2008
Replies: 5
Views: 214
Posted By bugmenot
Re: STL map?

This is wrong, by the way. "m[i]" looks up "i" as a key in the map. So it will not only fail to compile when "T" is not "int"; but even when it is an int, the binding might not exist.
Forum: Java May 18th, 2008
Replies: 11
Views: 811
Posted By bugmenot
Re: "Pointers" in Java

Yes, they are called "reference types". The references point to objects.
.

You mean that you cannot have objects as values, then yes.


Yes, they are called primitive types.


Basically. There is no...
Forum: C++ May 15th, 2008
Replies: 1
Views: 133
Posted By bugmenot
Re: Error with sorting?

it's right. vector doesn't have a method named "length()". it does have a method named "size()".
Forum: C++ May 15th, 2008
Replies: 2
Views: 154
Posted By bugmenot
Re: Using New

this one only works if the "3" part is a constant, and always creates a "rectangular" array made of contiguous parts, no pointers involved
Forum: C++ May 14th, 2008
Replies: 9
Views: 363
Posted By bugmenot
Re: using a vector::iterator

Next time, at least put in minimal effort and post an error or something; instead of other people repeatedly posting suggestions, and you just saying "doesn't work" each time without any clue as to...
Forum: Network Security May 13th, 2008
Replies: 112
Views: 120,941
Posted By bugmenot
Re: How do you bypass school/corporate internate filters

It does not need an uninstall code on Vista, but it does on XP. I suspect that it will soon need a code on Vista though.

If you call them at the 800 help number on their site, they can help you...
Forum: C++ May 12th, 2008
Replies: 3
Views: 169
Posted By bugmenot
Re: Pointer Question

how about
root = new Node<K>(newKey, NULL, NULL);
Forum: C++ May 11th, 2008
Replies: 7
Views: 309
Posted By bugmenot
Re: Expandable Array Problems

Also, a fundamental problem with your grow() function:

The last line is completely useless, because "array" is a local variable, assigning it has no effect outside the function.
Forum: C++ May 9th, 2008
Replies: 2
Views: 356
Posted By bugmenot
Re: recursive binary search tree

So these are all very self-explanatory. What part of the errors don't you understand?


Apparently Find() takes two arguments (a bool reference as a second argument) and doesn't return anything;...
Forum: C++ May 6th, 2008
Replies: 3
Views: 233
Posted By bugmenot
Re: confused by const

the second and fourth const are utterly and completely pointless. there is never a point to declare that a value passed by value is not going to be modified. you should remove them
Forum: C++ May 3rd, 2008
Replies: 5
Views: 1,256
Posted By bugmenot
Re: C++ static class

static local variables and static data members have lifetimes like global variables (there is only one copy in the program, and it exists for the whole duration of the program), except that their...
Forum: C++ May 3rd, 2008
Replies: 4
Views: 216
Posted By bugmenot
Re: conversion from binnary to octal

sum should be set to 0 at the beginning of every iteration of the outer loop

and i is only incremented at every block of three, so "bin[i]" is the same all three times
Forum: C++ May 2nd, 2008
Replies: 7
Views: 209
Posted By bugmenot
Re: Help with sphere member functions

wow.

what did you expect that code to do?
Forum: C++ May 2nd, 2008
Replies: 4
Views: 187
Posted By bugmenot
Re: push_back not saving order?

except that it doesn't check bounds
Forum: C++ May 2nd, 2008
Replies: 3
Views: 170
Posted By bugmenot
Re: what is wrong with this code?

should probably be
opOverload obj1(10,20);
opOverload obj2(30,40);
Forum: Java May 2nd, 2008
Replies: 4
Views: 494
Posted By bugmenot
Re: How to create an executable file in java

No. You compile it once to .class files. Then you run the .class files with "java MyClass".
Forum: C++ May 1st, 2008
Replies: 5
Views: 246
Posted By bugmenot
Re: downloading bloodshed dev

just download it from the sourceforge project
http://sourceforge.net/projects/dev-cpp/
Forum: C++ Apr 29th, 2008
Replies: 2
Views: 148
Posted By bugmenot
Re: Inheritance Issues (calling inherited methods)

you need to make the method in the base class virtual
http://en.wikipedia.org/wiki/Virtual_function
Forum: C++ Apr 29th, 2008
Replies: 4
Views: 434
Posted By bugmenot
Re: Erasing Elements in a Vector

if you need to delete arbitrary elements a lot, then perhaps you don't want to use a vector, because it is very expensive, both to find it and to shift all the remaining elements
Forum: C++ Apr 28th, 2008
Replies: 3
Views: 248
Posted By bugmenot
Re: Can't od the complie

and why can't you just tell us what is wrong with it?
Forum: C++ Apr 26th, 2008
Replies: 3
Views: 240
Posted By bugmenot
Re: Help needed for writing a general Node class in C++

a completely literal translation into C++ would be like this:
class Node{
private:
void *item;
Node *next;

public:
Node(void *obj) : item(obj) { }
void *getItem() const { return...
Forum: Java Apr 26th, 2008
Replies: 7
Views: 424
Posted By bugmenot
Re: Reversing a number

you could either get all the digits out into a list or something, and then parse them back into a number in reverse

or just take the input as a string and reverse the string
Forum: Java Apr 25th, 2008
Replies: 2
Views: 308
Posted By bugmenot
Re: Problem with protected member access

why don't you post code that actually compiles?
Forum: C++ Apr 24th, 2008
Replies: 6
Views: 501
Posted By bugmenot
Re: Passing pointer to matrix to caller?

you probably wanted
float* matrixa = new float[6];
Forum: C++ Apr 24th, 2008
Replies: 14
Views: 1,176
Posted By bugmenot
Re: hcf and lcm

note that with any two numbers a and b, a * b = gcd(a, b) * lcm(a, b)
Forum: C++ Apr 24th, 2008
Replies: 5
Views: 240
Posted By bugmenot
Re: Returning reference parameter in bool func

start with this
bool discr(double array2[3], double &result)
do you know how to use c++ references?
Forum: Java Apr 23rd, 2008
Replies: 17
Views: 523
Posted By bugmenot
Re: null pointer exception --- urgent

why don't you post the exception and stack trace, and post the code inside code tags
Forum: C++ Apr 22nd, 2008
Replies: 2
Views: 367
Posted By bugmenot
Re: C++ class as function pointer

no, it is better that you make the class a functor class (its has an overloaded function call operator); and then you should template the sort function, so it can either take a function pointer or a...
Forum: Java Apr 21st, 2008
Replies: 9
Views: 373
Posted By bugmenot
Showing results 1 to 40 of 174

 
All times are GMT -4. The time now is 5:44 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC