bugmenot 25 Posting Whiz in Training

If there is truly a legitimate reason for a subclass to want to access a field, it should be declared "protected".

bugmenot 25 Posting Whiz in Training

Is there any programming reason why I always see function definitions with arguments like this:

char getchar(char *arr){

Instead of this?:

char getchar(char arr[]){

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 value or something like that.

Also this code:

const char anonymous[ ] = "123";
char *arr = anonymous;

Didn't work for me, it gives a " invalid conversion from `const char*' to `char*'" compile error.

Yes. Either "arr" needs be changed to be declared as "const char *", or "anonymous" needs be changed to be declared as "char []".

Would it be correct to say that char *arr = "123"; is like this to the compiler:

char anonymous[ ] = "123";      
char *arr = anonymous;

Without the constant declaration?

No. There are two special syntaxes here. But they are very different. The line 'char *arr = "123" ' makes a string literal (which is stored specially in some special part of memory by the compiler, and exists for the entire duration of the program) and gives the location of that to the pointer. The second code example creates an array which is a local variable of the current function, and initializes it. As a local variable, it only exists until the function returns, so it would be bad to return a pointer to it or refer it …

bugmenot 25 Posting Whiz in Training

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 regain the admin password.

bugmenot 25 Posting Whiz in Training

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

void grow(int array[], int newnumber, int oldsize)
{
//...
    array = temp;   // swap contents back to array
}

The last line is completely useless, because "array" is a local variable, assigning it has no effect outside the function.

bugmenot 25 Posting Whiz in Training
sphere::sphere()        //default constructor
{
	int Radius=0;
}

wow.

what did you expect that code to do?

Ancient Dragon commented: I missed that :) +28
bugmenot 25 Posting Whiz in Training

1) when using vectors you can access individual elelements just as you would do with a simple int array B = LiDARGrid.ConcentricScans.[scancounter].getColumn(concentriccol);

except that it doesn't check bounds

bugmenot 25 Posting Whiz in Training

just download it from the sourceforge project
http://sourceforge.net/projects/dev-cpp/

bugmenot 25 Posting Whiz in Training

you need to make the method in the base class virtual
http://en.wikipedia.org/wiki/Virtual_function

bugmenot 25 Posting Whiz in Training

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

bugmenot 25 Posting Whiz in Training

note that with any two numbers a and b, a * b = gcd(a, b) * lcm(a, b)

bugmenot 25 Posting Whiz in Training

why don't you post the exception and stack trace, and post the code inside code tags

bugmenot 25 Posting Whiz in Training

can we see more code? for example, what types are all these things? how are they defined?

bugmenot 25 Posting Whiz in Training
if(hash.containsKey(hash.get(info)))

This line makes no sense; you are getting the value that is associated with the key "info", and then you are testing whether that value is a key in the hash table?

bugmenot 25 Posting Whiz in Training

maybe you are using a C compiler instead of C++

bugmenot 25 Posting Whiz in Training

um... where is your code?

bugmenot 25 Posting Whiz in Training
Candies[0] = {"Violent Crumple", 20.5, 7000};

which I know doesn't work (syntax error) - but why not??

I think this will be possible in the next version of C++

bugmenot 25 Posting Whiz in Training

result is set to 10 in the last iteration of the first for loop

and then you assign result (10) to every element of your 2-d array in the other for loops

bugmenot 25 Posting Whiz in Training

so lets look at line 112:

truckinfo[i].Set(inputhp, inputmileage, inputyear);

The two references that you dereference in that line are "truckinfo" and "truckinfo". "truckinfo" isn't null because you initialized it to a new array before the loop.

As for "truckinfo", no elements of the array have ever been set to anything in your code. "truckinfo" is an array of references, so all the elements are initialized to null by default.

bugmenot 25 Posting Whiz in Training

there are numeric_limits<float>::quiet_NaN() and numeric_limits<float>::signaling_NaN()

bugmenot 25 Posting Whiz in Training
bugmenot 25 Posting Whiz in Training

do you mean, "it doesn't compile"? there are no classes named Widget, Spork, or Grommet; how do you expect to create new objects of those classes?

bugmenot 25 Posting Whiz in Training

string is in the std namespace

bugmenot 25 Posting Whiz in Training

if you just used pointers

#ifndef LINE_H
#define LINE_H

class Point;

class Line
{
	// Ax+By+C = 0
	double A,B,C;
	Point *p1, *p2;

public:

	Line();

	Line(Point *P1, Point *P2);

	~Line() {}

	double getA() { return A;}
	double getB() {	return B;}
	double getC() {	return C;}
	Point *getP1() {return p1;}
	Point *getP2() {return p2;}
};

#endif
bugmenot 25 Posting Whiz in Training

So is this the equivalent of the following in C++?

yes. (except that in Java the first object is garbage-collected and in C++ it isn't)

bugmenot 25 Posting Whiz in Training

you should read a basic guide to Java

Java consists only of primitive types and reference types (which are kind of like pointers in C). Reference types point to objects, and are named after the class of objects they point to. Objects are not values in Java; and are always manipulated via references.

bugmenot 25 Posting Whiz in Training

what exactly is your question?

why can't the classes be separate and you just put each class in its own file?

also the "main" method should be static

bugmenot 25 Posting Whiz in Training

what is "execution via a webpage"?

bugmenot 25 Posting Whiz in Training

if "\" were the separator, you would do

str.split("\\\\")

the reason is that the argument to split() is compiled into a regular expression; and characters which are special in regex need to be quoted

the backslash is also the escape characters for strings in general, and needs to be doubled

a better way is to use the Pattern.quote() method to quote strings, so you don't have to escape special characters, like

str.split(Pattern.quote("*"));
str.split(Pattern.quote("\\"));

for "*" and "\" separators respectively

bugmenot 25 Posting Whiz in Training

Scanner.next() returns up to the next delimeter, which is a space by default

what do you expect it to do?

if you want to read the rest of the line, you can use the "nextLine()" method

bugmenot 25 Posting Whiz in Training
attribute[] attr=new attribute[no_of_attribute];

attr has no_of_attribute arguments

for(int i=0;i<no_of_entity;i++){

i goes from 0 to no_of_entity

for(int j=0;j<no_of_attribute;j++){

j goes from 0 to no_of_attribute

j is never used

System.out.println("The name of the attribute="+this.attr[i].name);

you access attr

but i might be bigger than the size of attr, which is no_of_attribute
because no_of_entity might be bigger than no_of_attribute

PoovenM commented: Good one on the debug! +2
bugmenot 25 Posting Whiz in Training

there are two lines of

Class.forName ("oracle.jdbc.driver.OracleDriver");

in your code

bugmenot 25 Posting Whiz in Training

there are two lines where you call that method; you caught the exception for the second one, but not the first

bugmenot 25 Posting Whiz in Training
char* ar2 = new char(strlen(ar));
array[top] = new char (strlen(ele));

oh my god, you are allocating one character, and then you are setting that character to the character that has the ASCII value that is the length of some other string

look at it

bugmenot 25 Posting Whiz in Training

Hi freddiecool and welcome to DaniWeb,

Not sure if this is your problem, but your variables should be initialised as private. ie:

private pryDialog pd = new pryDialog();
private int option = 0;

No, those are local variables inside the method. They do not have access modifiers like "private".

bugmenot 25 Posting Whiz in Training

Bushii...your advice works mate. Simple as ABC. Sceptic at 1st but hey presto..it works right after i restart my comp. Thanks a million mate.

bugmenot 25 Posting Whiz in Training

How???
how can u update your speed from 3 kbps to 205 kbps??
plz tell me................plzzzzzzzzzzzzzzz

reply me the update procedure on:
hassaanid2008@yahoo.com

Thanks..............:)

bugmenot 25 Posting Whiz in Training

It doesn't seem to work for me unfortunately, i have tried everything but nothing seems to delete the file! :-(

Can you please help me?

No, the DMR's method works. You just have to start command prompt cmd at START/RUN. Then you navigate in CMD to the folder where this crazy nasty file is, in this case the Office 10 folder. Once you are there, you type regsvr....... bla bla after /u put just the file name MSOHEV.DLL. And hit enter.

After a few seconds it will tell you it has been done. They you can delete the file immediately or after next reboot (depends on whether you reboted computer since you uninstalled Office.)

The Killbox.exe method should also work. This is like taking a canon to hit a fly.

Cheers.